[JBoss JIRA] (WFLY-11233) allow EntityManager caching in the JPA container
by James Perkins (Jira)
[ https://issues.jboss.org/browse/WFLY-11233?page=com.atlassian.jira.plugin... ]
James Perkins updated WFLY-11233:
---------------------------------
Fix Version/s: (was: 15.0.0.CR1)
> allow EntityManager caching in the JPA container
> ------------------------------------------------
>
> Key: WFLY-11233
> URL: https://issues.jboss.org/browse/WFLY-11233
> Project: WildFly
> Issue Type: Feature Request
> Components: JPA / Hibernate
> Reporter: Scott Marlow
> Assignee: Scott Marlow
> Priority: Major
>
> It could be interesting to see if caching EntityManager instances (per EntityManagerFactory) could improve performance for applications, that could benefit from that.
> The JPA 2.2 specification mentions the below, pay particular attention to the text "whether entity manager instances are sometimes reused" in section 7.8.2, also look at mention of [88]:
> {quote}
> 7.8 Requirements on the Container
> 7.8.1 Application-managed Persistence Contexts
> When application-managed persistence contexts are used, the container must instantiate the entity manager factory and expose it to the application via JNDI. The container might use internal APIs to create the entity manager factory, or it might use the PersistenceProvider.createContainerEntityManagerFactory method. However, the container is required to support third-party persistence providers, and in this case the container must use the PersistenceProvider.createContainerEntityManagerFactory method to create the entity manager factory and the EntityManagerFactory.close method to destroy the entity manager factory prior to shutdown (if it has not been previously closed by the application).
> 7.8.2 Container Managed Persistence Contexts
> The container is responsible for managing the lifecycle of container-managed persistence contexts, for injecting EntityManager references into web components and session bean and message-driven bean components, and for making EntityManager references available to direct lookups in JNDI. When operating with a third-party persistence provider, the container uses the contracts defined in section 7.9 to create and destroy container-managed persistence contexts. It is undefined whether a new entity manager instance is created for every persistence context, or whether entity manager instances are sometimes reused. Exactly how the container maintains the association between persistence context and JTA transaction is not defined. If a persistence context is already associated with a JTA transaction, the container uses that persistence context for subsequent invocations within the scope of that transaction, according to the semantics for persistence context propagation defined in section 7.6.4.
> 7.9 Runtime Contracts between the Container and Persistence Provider
> This section describes contracts between the container and the persistence provider for the pluggability of third-party persistence providers. Containers are required to support these pluggability contracts. [87]
> 7.9.1 Container Responsibilities
> For the management of a transaction-scoped persistence context, if there is no EntityManager already associated with the JTA transaction:
> * The container creates a new entity manager by calling EntityManagerFactory.createEntityManager when the first invocation of an entity manager with PersistenceContextType.TRANSACTION occurs within the scope of a business method executing in the JTA transaction.
> * After the JTA transaction has completed (either by transaction commit or rollback), the container closes the entity manager by calling EntityManager.close. [88] Note that the JTA transaction may rollback in a background thread (e.g., as a result of transaction timeout), in which case the container should arrange for the entity manager to be closed but the EntityManager.close method should not be concurrently invoked while the application is in an EntityManager invocation.
> The container must throw the TransactionRequiredException if a transaction-scoped persistence context is used and the EntityManager persist, remove, merge, or refresh method is invoked when no transaction is active.
> For stateful session beans with extended persistence contexts:
> * The container creates an entity manager by calling EntityManagerFactory.createEntityManager when a stateful session bean is created that declares a dependency on an entity manager with PersistenceContextType.EXTENDED. (See section 7.6.3).
> * The container closes the entity manager by calling EntityManager.close after the stateful session bean and all other stateful session beans that have inherited the same persistence context as the entity manager have been removed.
> * When a business method of the stateful session bean is invoked, if the stateful session bean uses container managed transaction demarcation, and the entity manager is not already associated with the current JTA transaction, the container associates the entity manager with the current JTA transaction and, if the persistence context is of type SynchronizationType.SYNCHRONIZED, the container calls EntityManager.joinTransaction. If there is a different persistence context already associated with the JTA transaction, the container throws the EJBException.
> * When a business method of the stateful session bean is invoked, if the stateful session bean uses bean managed transaction demarcation and a UserTransaction is begun within the method, the container associates the persistence context with the JTA transaction and, if the persistence context is of type SynchronizationType.SYNCHRONIZED, the container calls EntityManager.joinTransaction.
> The container must throw the IllegalStateException if the application calls EntityManager.close on a container-managed entity manager.
> [87] It is not required that these contracts be used when a third-party persistence provider is not used: the container might use these same APIs or its might use its own internal APIs.
> [88] The container may choose to pool EntityManagers: it instead of creating and closing in each case, it may acquire one from its pool and call clear() on it.
> {quote}
> One challenge with introducing an entity manager (per EntityManagerFactory) cache, is knowing when to close EntityManagers after certain errors have occurred on the EntityManager. To deal with this robustness issue, we will discard entity managers that are marked close when retrieving them from the cache. To ensure that we always put the cached EM back in cache, EntityManagerCache use is only done within JTA transactions, since we have control of the release (closing) of the EntityManager and only with SynchronizationType.SYNCHRONIZED (never with SynchronizationType.UNSYNCHRONIZED) persistence contexts.
> For this jira, the EntityManagerCache keeps strong references to the (cleared) EntityManager's from the cache. If this causes users OOM errors, we could consider using SOFT references so that the EntityManager's could be GCd in low memory conditions. We also offer users a choice between an unbounded cache (size=0) and a bounded cache. Users that have problems with OOM errors, should switch to a bounded cache.
> Persistence unit hint "wildfly.jpa.emcache", may be:
> * true, per EntityManagerFactory/persistence unit) cache that is shared between multiple threads.
> * false (default), no caching is performed.
> Persistence unit hint "wildfly.jpa.emcache.size", may be:
> * 0 (default), the cache (if enabled) is unbounded.
> * N, where N is the max number of EntityManager instances that can be placed in the EntityManagerCache, in between application use.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years
[JBoss JIRA] (WFLY-11242) Provide builtin ParamConverter* classes for multi valued params
by James Perkins (Jira)
[ https://issues.jboss.org/browse/WFLY-11242?page=com.atlassian.jira.plugin... ]
James Perkins updated WFLY-11242:
---------------------------------
Fix Version/s: (was: 15.0.0.CR1)
> Provide builtin ParamConverter* classes for multi valued params
> ---------------------------------------------------------------
>
> Key: WFLY-11242
> URL: https://issues.jboss.org/browse/WFLY-11242
> Project: WildFly
> Issue Type: Feature Request
> Reporter: Marek Kopecký
> Assignee: Ron Sigal
> Priority: Major
>
> This is follow up for RESTEASY-1746 and RESTEASY-1566. In these feature jiras, users needs to prepare custom ParamConverter* classes in deployment.
> This feature should provide builtin ParamConverter* universal classes.
> Some PoC is in [this commit|https://github.com/marekkopecky/Resteasy/commit/08e0eb6de206085593...]
> Suitable annotations for end-point can parametrize converter behaviour. [~ron_sigal]'s proposal:
> {noformat}Maybe annotations in
> > public <T> ParamConverter<T> getConverter(Class<T> rawType, Type genericType, Annotation[] annotations;
> could be used to generalize. E.g.,
> public Response conversion1(@QueryParam @Separator("&") List<MultiValueParamBuiltinMyObject1> q);
> Even more general could be something like
> public Response conversion1(@QueryParam @MultiSyntax(<regular expression/>) List<MultiValueParamBuiltinMyObject1> q) {{noformat}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years
[JBoss JIRA] (WFCORE-4132) LogManager stops any logging output after changing "encoding" attribute to file-handler
by James Perkins (Jira)
[ https://issues.jboss.org/browse/WFCORE-4132?page=com.atlassian.jira.plugi... ]
James Perkins commented on WFCORE-4132:
---------------------------------------
This will require an upgrade to {{org.jboss.logmanager:jboss-logmanager:2.2.0.Final}}.
> LogManager stops any logging output after changing "encoding" attribute to file-handler
> ---------------------------------------------------------------------------------------
>
> Key: WFCORE-4132
> URL: https://issues.jboss.org/browse/WFCORE-4132
> Project: WildFly Core
> Issue Type: Bug
> Components: Logging
> Reporter: Masafumi Miura
> Assignee: James Perkins
> Priority: Major
>
> When setting "encoding" attribute on the file handler (file-handler, periodic-rotating-file-handler, size-rotating-file-handler, and periodic-size-rotating-file-handler) in CLI, LogManager throw the following error message in the console log and stops any logging output to the file-handler.
> Note that the stack trace below "org.jboss.logmanager.Logger.logRaw(Logger.java:850)" can differ. It looks like this error just happens on the first logging output after the configuration change.
> Even after executing ":reload" the instance via CLI, no log message are output to the file-handler. The instance needs to restart to output the file-handler.
> {code}
> LogManager error of type FLUSH_FAILURE: Error on flush
> java.io.IOException: Stream Closed
> at java.io.FileOutputStream.writeBytes(Native Method)
> at java.io.FileOutputStream.write(FileOutputStream.java:326)
> at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
> at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
> at org.jboss.logmanager.handlers.UninterruptibleOutputStream.flush(UninterruptibleOutputStream.java:110)
> at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
> at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
> at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
> at java.io.BufferedWriter.flush(BufferedWriter.java:254)
> at org.jboss.logmanager.handlers.WriterHandler.safeFlush(WriterHandler.java:170)
> at org.jboss.logmanager.handlers.WriterHandler.flush(WriterHandler.java:139)
> at org.jboss.logmanager.ExtHandler.doPublish(ExtHandler.java:105)
> at org.jboss.logmanager.handlers.WriterHandler.doPublish(WriterHandler.java:67)
> at org.jboss.logmanager.ExtHandler.publish(ExtHandler.java:77)
> at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:333)
> at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)
> at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)
> at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)
> at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)
> at org.jboss.logmanager.LoggerNode.publish(LoggerNode.java:341)
> at org.jboss.logmanager.Logger.logRaw(Logger.java:850)
> at org.jboss.logmanager.Logger.log(Logger.java:802)
> at org.jboss.logging.JBossLogManagerLogger.doLogf(JBossLogManagerLogger.java:53)
> at org.jboss.logging.Logger.logf(Logger.java:2398)
> at org.jboss.as.mail.extension.MailLogger_$logger.unboundMailSession(MailLogger_$logger.java:42)
> at org.jboss.as.mail.extension.MailSessionAdd$1.handleEvent(MailSessionAdd.java:150)
> at org.jboss.msc.service.ServiceControllerImpl$LifecycleListenerTask.execute(ServiceControllerImpl.java:1857)
> at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
> at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
> at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
> at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1364)
> at java.lang.Thread.run(Thread.java:748)
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years
[JBoss JIRA] (DROOLS-3393) Please review scenario error cell text for legibility/accessibility.
by Liz Clayton (Jira)
[ https://issues.jboss.org/browse/DROOLS-3393?page=com.atlassian.jira.plugi... ]
Liz Clayton commented on DROOLS-3393:
-------------------------------------
p.s. [~kkufova] [~bdellasc] Please advise also if you think the error state needs a redundant cue of some sort (icon, bolded cell border...), rather than relying on color alone. Thanks!
> Please review scenario error cell text for legibility/accessibility.
> ---------------------------------------------------------------------
>
> Key: DROOLS-3393
> URL: https://issues.jboss.org/browse/DROOLS-3393
> Project: Drools
> Issue Type: Task
> Components: Scenario Simulation and Testing
> Reporter: Liz Clayton
> Assignee: Klara Kufova
> Priority: Major
> Labels: ScenarioSimulation, UX, UXTeam
> Attachments: Screen Shot 2018-11-30 at 11.59.32 AM.png, Screen Shot 2018-11-30 at 12.05.50 PM.png, Screenshot from 2018-11-30 17-11-43.png
>
>
> [~kkufova] [~bdellasc]
> I noticed that the error text is a little "fuzzy" looking, the edges aren't very sharp and I was concerned that it might not be legible. I asked Danielle about the specs for it and it's the same size just bolded.
> I did an online accessibility text using the following tool, with our current hex values: https://webaim.org/resources/contrastchecker/. It failed for level 3 compliance, but I'm not sure we need to shoot for that or not? I tried the darker PatternFly red color "#8b0000" and it passed at all levels, even at smaller sizes.
> I'm wondering if we could use the darker red, in the non-bolded font? And if so, perhaps the text would be a little bit more legible.
> Just wanted to ask about this, please let me know what you think.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years
[JBoss JIRA] (DROOLS-3049) [DMN Designer] NameAndDataTypeEditorViewImpl needs to hide if the User navigates to the Data Type dialog
by Guilherme Carreiro (Jira)
[ https://issues.jboss.org/browse/DROOLS-3049?page=com.atlassian.jira.plugi... ]
Guilherme Carreiro updated DROOLS-3049:
---------------------------------------
Labels: drools-tools (was: )
> [DMN Designer] NameAndDataTypeEditorViewImpl needs to hide if the User navigates to the Data Type dialog
> ---------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-3049
> URL: https://issues.jboss.org/browse/DROOLS-3049
> Project: Drools
> Issue Type: Bug
> Components: DMN Editor
> Affects Versions: 7.12.0.Final
> Reporter: Michael Anstis
> Assignee: Guilherme Carreiro
> Priority: Minor
> Labels: drools-tools
>
> The {{NameAndDataTypeEditorViewImpl}} contains a link to the "Data Type Dialog". When this is clicked on the dialog is displayed and the _source_ {{Popover}} remains visible. When the User clicks on the dialog a mouse event is detected that is not _over_ the {{Popover}} and it closes. The proposal is to close the {{Popover}} if the User clicks on the link to the "Data Type Dialog".
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years