[JBoss JIRA] (WFLY-10404) Review/revise 2lc caching design
by James Perkins (Jira)
[ https://issues.jboss.org/browse/WFLY-10404?page=com.atlassian.jira.plugin... ]
James Perkins updated WFLY-10404:
---------------------------------
Fix Version/s: 15.0.0.CR1
(was: 15.0.0.Beta1)
> Review/revise 2lc caching design
> --------------------------------
>
> Key: WFLY-10404
> URL: https://issues.jboss.org/browse/WFLY-10404
> Project: WildFly
> Issue Type: Feature Request
> Components: Clustering, JPA / Hibernate
> Affects Versions: 13.0.0.Beta1
> Reporter: Scott Marlow
> Assignee: Paul Ferraro
> Priority: Major
> Fix For: 15.0.0.CR1
>
>
> Review cache isolation, cache region factories, override ISPN default behavior to handle more efficient names, updates to infinispan-hibernate-cache-spi, app configuration choices for choosing different strategies.
> * Avoid the ByteString byte length limitation of 255 ([https://github.com/infinispan/infinispan/commit/046517fc0829bb0a1768169e5...]) in region name prefix + region name as cache key. Also see [https://issues.jboss.org/browse/ISPN-9206].
> * Enhance the org.jboss.as.jpa.hibernate5.service.WildFlyCustomRegionFactoryInitiator to improve caching for:
> ** container managed persistence units
> ** non-container-managed persistence unit (e.g. native Hibernate or app calls into javax.persistence.Persistence.createEntityManagerFactory())
> ** WildFlyCustomRegionFactoryInitiator cannot start an Infinispan cache by default, should we offer an API/SPI that Spring could implement for specifying the cache (service) to be used for a particular persistence unit? The application could specify the custom API/SPI implementation class via a persistence unit property.
> *** Currently, Hibernate defaults the 2lc on but that fails when the Infinispan cache is not automatically started, so WildFlyCustomRegionFactoryInitiator defaults caching off.
> *** If this is not possible, then keep the current WildFlyCustomRegionFactoryInitiator logic to default Hibernate caching off, unless the app requests caching via configuration settings.
>
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months
[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: 15.0.0.CR1
(was: 15.0.0.Beta1)
> 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
> Fix For: 15.0.0.CR1
>
>
> 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, 8 months
[JBoss JIRA] (WFLY-11214) Periodic recovery does not recover XAResource after jvm crash when agroal subsystem is used
by James Perkins (Jira)
[ https://issues.jboss.org/browse/WFLY-11214?page=com.atlassian.jira.plugin... ]
James Perkins updated WFLY-11214:
---------------------------------
Fix Version/s: 15.0.0.CR1
(was: 15.0.0.Beta1)
> Periodic recovery does not recover XAResource after jvm crash when agroal subsystem is used
> -------------------------------------------------------------------------------------------
>
> Key: WFLY-11214
> URL: https://issues.jboss.org/browse/WFLY-11214
> Project: WildFly
> Issue Type: Bug
> Components: Agroal, Transactions
> Reporter: Ivan Straka
> Assignee: Luis Barreiro
> Priority: Blocker
> Fix For: 15.0.0.CR1
>
> Attachments: JPACrashRecoveryTestCase_commitHaltSecond_jta_server.log, JPACrashRecoveryTestCase_commitHaltSecond_jts_server.log
>
>
> Scenario:
> Halts server at commit phase ...
> # enlist TestXA resource
> # enlist XA resource
> # prepare TestXA resource
> # prepare XA resource
> # commit Test XA resource
> # JVM crash
> # recovery started
> # commit XA resource
> Periodic recovery does not recover xa resource. It looks like agroal subsystem does not register xa resource to xa recovery module.
> Test outcome:
> {code:java}
> Running org.jboss.as.test.jbossts.crashrec.test.JPACrashRecoveryTestCase
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 109.002 sec <<< FAILURE! - in org.jboss.as.test.jbossts.crashrec.test.JPACrashRecoveryTestCase
> commitHaltSecond(org.jboss.as.test.jbossts.crashrec.test.JPACrashRecoveryTestCase) Time elapsed: 102.976 sec <<< FAILURE!
> java.lang.AssertionError: Incorrect data in database after crash recovery. expected:<2> but was:<1>
> at org.junit.Assert.fail(Assert.java:88)
> at org.junit.Assert.failNotEquals(Assert.java:834)
> at org.junit.Assert.assertEquals(Assert.java:645)
> at org.jboss.as.test.jbossts.crashrec.test.JPABaseCrashRecoveryTestCase.checkAfterTestExecution(JPABaseCrashRecoveryTestCase.java:150)
> at org.jboss.as.test.jbossts.crashrec.test.TestBaseCrashRecovery.commitHaltTest(TestBaseCrashRecovery.java:485)
> at org.jboss.as.test.jbossts.crashrec.test.TestBaseCrashRecovery.commitHaltSecond(TestBaseCrashRecovery.java:418)
> at org.jboss.as.test.jbossts.crashrec.test.JPACrashRecoveryTestCase.commitHaltSecond(JPACrashRecoveryTestCase.java:76)
> {code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months
[JBoss JIRA] (WFLY-11143) Message sent to JMSReplyTo from old client does not find correct binding
by James Perkins (Jira)
[ https://issues.jboss.org/browse/WFLY-11143?page=com.atlassian.jira.plugin... ]
James Perkins updated WFLY-11143:
---------------------------------
Fix Version/s: 15.0.0.CR1
(was: 15.0.0.Beta1)
> Message sent to JMSReplyTo from old client does not find correct binding
> ------------------------------------------------------------------------
>
> Key: WFLY-11143
> URL: https://issues.jboss.org/browse/WFLY-11143
> Project: WildFly
> Issue Type: Bug
> Components: JMS
> Affects Versions: 14.0.0.Final
> Reporter: Miroslav Novak
> Assignee: Martyn Taylor
> Priority: Blocker
> Fix For: 15.0.0.CR1
>
>
> There is regression in backward compatibility of messaging client. JMSReplyTo destination set by older client contains incorrect address which causes that reply message does not have correct binding and such message is lost.
> Impact: Applications will stop work after upgrade to WF14/EAP 7.2.0.CD14.
> Test Scenario:
> * Start EAP 7.2.0.CD14/WF14 server (Artemis 2.x) with deployed InQueue and OutQueue
> * Send message to InQueue from older EAP 7.2.0.CD13/WF13/Artemis 1.5.5 client to InQueue. Message has JMSReplyTo header set to OutQueue. Client got "OutQueue" queue from JNDI lookup from EAP7.2.0.CD14/WF14
> * Deploy MDB to server
> ** MDB consumes message from InQueue and sends new message to destination defined in JMSReplyTo header (so to OutQueue)
> * Receive message from OutQueue
> Result:
> No message is received from OutQueue. There is debug message in server log:
> {code}
> 11:36:09,565 DEBUG [org.apache.activemq.artemis.core.postoffice.impl.PostOfficeImpl] (Thread-25 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$5@22848193)) Message CoreMessage[m
> essageID=214,durable=true,userID=c0de8bd0-cba6-11e8-840f-f496342f6705,priority=4, timestamp=Tue Oct 09 11:36:09 CEST 2018,expiration=0, durable=true, address=jms.queue.OutQueue,size=580,properties=TypedPropertie
> s[inMessageId=ID:c0383a39-cba6-11e8-95ad-f496342f6705,__AMQ_CID=c0d9349a-cba6-11e8-840f-f496342f6705,_AMQ_DUPL_ID=90d1e80e-116d-4eef-9513-84c6085549db,_AMQ_ROUTING_TYPE=0]]@1680840457 is not going anywhere as it
> didn't have a binding on address:jms.queue.OutQueue
> {code}
> which indicates that jms.queue.OutQueue address does not have a binding.
> The same happesn if older EAP/WF server (with Artemis 1.5.5x) is used and new EAP 7.2.0.CD14/WF14(Artemis 2.x) client is used.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months
[JBoss JIRA] (WFLY-11101) Add CredentialStore documentation
by James Perkins (Jira)
[ https://issues.jboss.org/browse/WFLY-11101?page=com.atlassian.jira.plugin... ]
James Perkins updated WFLY-11101:
---------------------------------
Fix Version/s: 15.0.0.CR1
(was: 15.0.0.Beta1)
> Add CredentialStore documentation
> ---------------------------------
>
> Key: WFLY-11101
> URL: https://issues.jboss.org/browse/WFLY-11101
> Project: WildFly
> Issue Type: Task
> Components: Documentation, Security
> Reporter: Darran Lofthouse
> Assignee: Darran Lofthouse
> Priority: Major
> Fix For: 15.0.0.CR1
>
>
> The CredentialStore is a significant component within WildFly Elytron, however it is not really covered in the documentation.
> We have a couple of different approaches to creating the store, we then have referencing the store. Finally we have custom implementations.
> New features are also being developed so really we need a source of documentation to add descriptions of the new features to.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months
[JBoss JIRA] (WFLY-11073) Support hex encoding in jdbc-realm for elytron
by James Perkins (Jira)
[ https://issues.jboss.org/browse/WFLY-11073?page=com.atlassian.jira.plugin... ]
James Perkins updated WFLY-11073:
---------------------------------
Fix Version/s: 15.0.0.CR1
(was: 15.0.0.Beta1)
> Support hex encoding in jdbc-realm for elytron
> ----------------------------------------------
>
> Key: WFLY-11073
> URL: https://issues.jboss.org/browse/WFLY-11073
> Project: WildFly
> Issue Type: Feature Request
> Components: Documentation, Security
> Reporter: Jan Kalina
> Priority: Major
> Labels: elytron
> Fix For: 15.0.0.CR1
>
>
> Old database login-module can be configured passing the attribute {{hashEncoding}}, for example:
> {code:xml}
> <login-module code="Database" flag="required">
> <module-option name="dsJndiName" value="java:jboss/datasources/ExampleDS"/>
> <module-option name="principalsQuery" value="SELECT password FROM User WHERE username = ?"/>
> <module-option name="rolesQuery" value="SELECT role, 'Roles' FROM User WHERE username = ?"/>
> <module-option name="hashAlgorithm" value="SHA-1"/>
> <module-option name="hashEncoding" value="hex"/>
> <module-option name="hashCharset" value="UTF-8"/>
> </login-module>
> {code}
> Currently jdbc-realm in elytron only uses base64 encoding if hash is stored in a text column. This way the migration is more complicated cos the password hash is not valid changing from old security system to elytron.
> Think also about the charset attribute.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)
7 years, 8 months