[JBoss JIRA] (ISPN-3541) Purge is not working for file-store
by Mircea Markus (JIRA)
[ https://issues.jboss.org/browse/ISPN-3541?page=com.atlassian.jira.plugin.... ]
Mircea Markus commented on ISPN-3541:
-------------------------------------
what version are you using?
> Purge is not working for file-store
> -----------------------------------
>
> Key: ISPN-3541
> URL: https://issues.jboss.org/browse/ISPN-3541
> Project: Infinispan
> Issue Type: Bug
> Reporter: Jakub Markos
> Assignee: Mircea Markus
>
> When using this configuration (notice the purge=true)
> {code:xml}
> <local-cache name="default" start="EAGER" batching="false">
> <file-store name="hello"
> passivation="true"
> relative-to="temp"
> path="${cachestore.name}"
> purge="true"/>
> </local-cache>
> {code}
> and running this test
> {code}
> for (int i = 0; i < 3; i++) {
> cache.put("k" + i, i);
> }
> controller.stop(CONTAINER); // stops the server
> controller.start(CONTAINER);
> for (int i = 0; i < 3; i++) {
> System.out.println("k" + i + ": " + cache.get("k" + i));
> }
> {code}
> the entries can be read even after server restart:
> {quote}
> k0: 0 // expecting null here
> k1: 1 // expecting null here
> k2: 2 // expecting null here
> {quote}
> Worked fine with DR4, not with ER1.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 3 months
[JBoss JIRA] (ISPN-3541) Purge is not working for file-store
by Jakub Markos (JIRA)
Jakub Markos created ISPN-3541:
----------------------------------
Summary: Purge is not working for file-store
Key: ISPN-3541
URL: https://issues.jboss.org/browse/ISPN-3541
Project: Infinispan
Issue Type: Bug
Reporter: Jakub Markos
Assignee: Mircea Markus
When using this configuration (notice the purge=true)
{code:xml}
<local-cache name="default" start="EAGER" batching="false">
<file-store name="hello"
passivation="true"
relative-to="temp"
path="${cachestore.name}"
purge="true"/>
</local-cache>
{code}
and running this test
{code}
for (int i = 0; i < 3; i++) {
cache.put("k" + i, i);
}
controller.stop(CONTAINER); // stops the server
controller.start(CONTAINER);
for (int i = 0; i < 3; i++) {
System.out.println("k" + i + ": " + cache.get("k" + i));
}
{code}
the entries can be read even after server restart:
{quote}
k0: 0 // expecting null here
k1: 1 // expecting null here
k2: 2 // expecting null here
{quote}
Worked fine with DR4, not with ER1.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 3 months
[JBoss JIRA] (ISPN-3497) getCountRowsSql() has wrong SQL syntax
by Pedro Ruivo (JIRA)
[ https://issues.jboss.org/browse/ISPN-3497?page=com.atlassian.jira.plugin.... ]
Pedro Ruivo updated ISPN-3497:
------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
> getCountRowsSql() has wrong SQL syntax
> --------------------------------------
>
> Key: ISPN-3497
> URL: https://issues.jboss.org/browse/ISPN-3497
> Project: Infinispan
> Issue Type: Bug
> Components: Loaders and Stores
> Affects Versions: 6.0.0.Alpha4
> Reporter: Vitalii Chepeliuk
> Assignee: Mircea Markus
> Labels: jdg62blocker
> Fix For: 6.0.0.Beta2
>
>
> When I run tests with mysql database following exception is thrown
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) FROM `mix_str____defaultcache`' at line 1
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
> at com.mysql.jdbc.Util.getInstance(Util.java:386)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1053)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2503)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2664)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2794)
> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
> at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
> at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedStore.size(JdbcStringBasedStore.java:358)
> {code:title=TableManipulation.java|borderStyle=solid}
> public String getCountRowsSql() {
> if (countRowsSql == null) {
> countRowsSql = "SELECT COUNT (*) FROM " + getTableName(); <<< here should be COUNT(*) without space
> }
> return countRowsSql;
> }
> {code}
> MySQL is complaining when there is SPACE between COUNT and (*)
> >[Error] Script lines: 5-6 --------------------------
> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*) FROM `edg_string____defaultcache`' at line 1
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 3 months
[JBoss JIRA] (ISPN-3540) Persisting new entity with cached blind-side @OneToMany CMR field fails on transaction flush.
by Jari Juslin (JIRA)
[ https://issues.jboss.org/browse/ISPN-3540?page=com.atlassian.jira.plugin.... ]
Jari Juslin updated ISPN-3540:
------------------------------
Attachment: infinispan_bug_repro.zip
Reproduction project. Builds a WAR to reproduce the bug.
> Persisting new entity with cached blind-side @OneToMany CMR field fails on transaction flush.
> ---------------------------------------------------------------------------------------------
>
> Key: ISPN-3540
> URL: https://issues.jboss.org/browse/ISPN-3540
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 5.2.1.Final
> Environment: 64-bit Ubuntu 13.04, JBoss 7.2.0.Final, Hibernate 4.2.4.
> Reporter: Jari Juslin
> Assignee: Mircea Markus
> Attachments: infinispan_bug_repro.zip
>
>
> I have two entity beans, both transactionally cached and then n:m relationship between them. The one side maps the CMR relationship as a Set and sets it to be transactionally cached.
> Now when I create a new object on the one side, so that the Set containing the other side is empty, the transaction fails during the flush stage with the following message:
> WARN [org.infinispan.transaction.TransactionTable] (http-/0.0.0.0:8080-1:) ISPN000101: Failed synchronization registration: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
> If I leave the Set field null, it works.
> The beans:
> @Entity()
> @Table(name="k3_run")
> @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
> public class Run implements Serializable {
> private Integer id;
> private Set<Restriction> restrictions = new HashSet<>();
>
> @Id
> @GeneratedValue(strategy=GenerationType.IDENTITY)
> @Column(name = "id")
> public Integer getId() {
> return id;
> }
> public void setId(Integer id) {
> this.id = id;
> }
> @OneToMany
> @JoinColumn(name="run_fk")
> @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
> public Set<Restriction> getRestrictions() {
> return restrictions;
> }
> public void setRestrictions(Set<Restriction> restrictions) {
> this.restrictions = restrictions;
> }
> }
> @Entity
> @Table(name="k3_restriction")
> @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
> public class Restriction {
> private Integer id;
>
> @Id
> @GeneratedValue(strategy=GenerationType.IDENTITY)
> @Column(name = "id")
> public Integer getId() {
> return id;
> }
> public void setId(Integer id) {
> this.id = id;
> }
> }
> The RESTeasy service doing the creation:
> @Stateless
> @LocalBean
> @Path("/bug_repro")
> @TransactionAttribute(TransactionAttributeType.REQUIRED)
> public class RunRest {
> @PersistenceContext(unitName = "persistence_context")
> protected EntityManager entityManager;
> @POST
> @TransactionAttribute(TransactionAttributeType.REQUIRED)
> public String createRun() {
> final Run run = new Run();
> entityManager.persist(run);
> return "New run created with ID " + run.getId();
> }
> }
> This curl command used to invoke it:
> curl -H 'Content-Type: application/xml; charset=UTF-8' -X POST http://localhost:8080/infinispan_bug_reproduction/bug_repro
> The persistence.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
> version="2.0">
> <persistence-unit name="persistence_context" transaction-type="JTA">
> <provider>org.hibernate.ejb.HibernatePersistence</provider>
> <jta-data-source>java:/OperationalDS</jta-data-source>
> <properties>
> <property name="hibernate.hbm2ddl.auto" value="validate"/>
> <property name="hibernate.cache.use_second_level_cache" value="true"/>
> <property name="hibernate.cache.use_query_cache" value="true"/>
> </properties>
> </persistence-unit>
> </persistence>
> The datasource definition:
> <xa-datasource jndi-name="java:/OperationalDS" pool-name="MpkDemoUsDS" enabled="true">
> <xa-datasource-property name="ServerName">
> localhost
> </xa-datasource-property>
> <xa-datasource-property name="DatabaseName">
> production
> </xa-datasource-property>
> <driver>mysql</driver>
> <security>
> <user-name>k3</user-name>
> <password>********</password>
> </security>
> <validation>
> <check-valid-connection-sql>/* ping */ SELECT 1</check-valid-connection-sql>
> <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
> </validation>
> </xa-datasource>
> The stacktrace:
> 17:08:50,159 WARN [org.infinispan.transaction.TransactionTable] (http-/0.0.0.0:8080-1:) ISPN000101: Failed synchronization registration: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronizationImple(TransactionImple.java:374)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronization(TransactionImple.java:351)
> at org.infinispan.transaction.TransactionTable.enlist(TransactionTable.java:214)
> at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:271)
> at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:245)
> at org.infinispan.interceptors.TxInterceptor.visitRemoveCommand(TxInterceptor.java:201)
> at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
> at org.infinispan.interceptors.CacheMgmtInterceptor.visitRemoveCommand(CacheMgmtInterceptor.java:137)
> at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)
> at org.infinispan.commands.AbstractVisitor.visitRemoveCommand(AbstractVisitor.java:67)
> at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)
> at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1162)
> at org.infinispan.CacheImpl.removeInternal(CacheImpl.java:308)
> at org.infinispan.CacheImpl.remove(CacheImpl.java:302)
> at org.infinispan.DecoratedCache.remove(DecoratedCache.java:325)
> at org.infinispan.AbstractDelegatingCache.remove(AbstractDelegatingCache.java:313)
> at org.hibernate.cache.infinispan.access.TransactionalAccessDelegate.remove(TransactionalAccessDelegate.java:152) [hibernate-infinispan-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.cache.infinispan.collection.TransactionalAccess.remove(TransactionalAccess.java:48) [hibernate-infinispan-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.action.internal.CollectionAction.evict(CollectionAction.java:152) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:64) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:377) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:369) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:292) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:113) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
> at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
> at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
> at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
> at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:91) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:252) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at com.ecolane.mpk.rest.RunRest$$$view2.createRun(Unknown Source) [classes:]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_40]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_40]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_40]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.5.Final.jar:]
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 3 months
[JBoss JIRA] (ISPN-3540) Persisting new entity with cached blind-side @OneToMany CMR field fails on transaction flush.
by Jari Juslin (JIRA)
[ https://issues.jboss.org/browse/ISPN-3540?page=com.atlassian.jira.plugin.... ]
Jari Juslin updated ISPN-3540:
------------------------------
Description:
I have two entity beans, both transactionally cached and then n:m relationship between them. The one side maps the CMR relationship as a Set and sets it to be transactionally cached.
Now when I create a new object on the one side, so that the Set containing the other side is empty, the transaction fails during the flush stage with the following message:
WARN [org.infinispan.transaction.TransactionTable] (http-/0.0.0.0:8080-1:) ISPN000101: Failed synchronization registration: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
If I leave the Set field null, it works.
The beans:
@Entity()
@Table(name="k3_run")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Run implements Serializable {
private Integer id;
private Set<Restriction> restrictions = new HashSet<>();
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToMany
@JoinColumn(name="run_fk")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public Set<Restriction> getRestrictions() {
return restrictions;
}
public void setRestrictions(Set<Restriction> restrictions) {
this.restrictions = restrictions;
}
}
@Entity
@Table(name="k3_restriction")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Restriction {
private Integer id;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
The RESTeasy service doing the creation:
@Stateless
@LocalBean
@Path("/bug_repro")
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class RunRest {
@PersistenceContext(unitName = "persistence_context")
protected EntityManager entityManager;
@POST
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public String createRun() {
final Run run = new Run();
entityManager.persist(run);
return "New run created with ID " + run.getId();
}
}
This curl command used to invoke it:
curl -H 'Content-Type: application/xml; charset=UTF-8' -X POST http://localhost:8080/infinispan_bug_reproduction/bug_repro
The persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="persistence_context" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/OperationalDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
</properties>
</persistence-unit>
</persistence>
The datasource definition:
<xa-datasource jndi-name="java:/OperationalDS" pool-name="MpkDemoUsDS" enabled="true">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
production
</xa-datasource-property>
<driver>mysql</driver>
<security>
<user-name>k3</user-name>
<password>********</password>
</security>
<validation>
<check-valid-connection-sql>/* ping */ SELECT 1</check-valid-connection-sql>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</xa-datasource>
The stacktrace:
17:08:50,159 WARN [org.infinispan.transaction.TransactionTable] (http-/0.0.0.0:8080-1:) ISPN000101: Failed synchronization registration: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronizationImple(TransactionImple.java:374)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronization(TransactionImple.java:351)
at org.infinispan.transaction.TransactionTable.enlist(TransactionTable.java:214)
at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:271)
at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:245)
at org.infinispan.interceptors.TxInterceptor.visitRemoveCommand(TxInterceptor.java:201)
at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
at org.infinispan.interceptors.CacheMgmtInterceptor.visitRemoveCommand(CacheMgmtInterceptor.java:137)
at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)
at org.infinispan.commands.AbstractVisitor.visitRemoveCommand(AbstractVisitor.java:67)
at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)
at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1162)
at org.infinispan.CacheImpl.removeInternal(CacheImpl.java:308)
at org.infinispan.CacheImpl.remove(CacheImpl.java:302)
at org.infinispan.DecoratedCache.remove(DecoratedCache.java:325)
at org.infinispan.AbstractDelegatingCache.remove(AbstractDelegatingCache.java:313)
at org.hibernate.cache.infinispan.access.TransactionalAccessDelegate.remove(TransactionalAccessDelegate.java:152) [hibernate-infinispan-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.cache.infinispan.collection.TransactionalAccess.remove(TransactionalAccess.java:48) [hibernate-infinispan-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.action.internal.CollectionAction.evict(CollectionAction.java:152) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:64) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:377) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:369) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:292) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:113) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:91) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:252) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
at com.ecolane.mpk.rest.RunRest$$$view2.createRun(Unknown Source) [classes:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_40]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_40]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_40]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.5.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.5.Final.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
was:
I have two entity beans, both transactionally cached and then n:m relationship between them. The one side maps the CMR relationship as a Set and sets it to be transactionally cached.
Now when I create a new object on the one side, so that the Set containing the other side is empty, the transaction fails during the flush stage with the following message:
WARN [org.infinispan.transaction.TransactionTable] (http-/0.0.0.0:8080-1:) ISPN000101: Failed synchronization registration: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
If I leave the Set field null, it works.
The beans:
@Entity()
@Table(name="k3_run")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Run implements Serializable {
private Integer id;
private Set<Restriction> restrictions = new HashSet<>();
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToMany
@JoinColumn(name="run_fk")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public Set<Restriction> getRestrictions() {
return restrictions;
}
public void setRestrictions(Set<Restriction> restrictions) {
this.restrictions = restrictions;
}
}
@Entity
@Table(name="k3_restriction")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Restriction {
private Integer id;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
The RESTeasy service doing the creation:
@Stateless
@LocalBean
@Path("/bug_repro")
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class RunRest {
@PersistenceContext(unitName = "persistence_context")
protected EntityManager entityManager;
@POST
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public String createRun() {
final Run run = new Run();
entityManager.persist(run);
return "New run created with ID " + run.getId();
}
}
This curl command used to invoke it:
curl -H 'Content-Type: application/xml; charset=UTF-8' -X POST http://localhost:8080/infinispan_bug_reproduction/bug_repro
The persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="persistence_context" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/OperationalDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
</properties>
</persistence-unit>
</persistence>
The datasource definition:
<xa-datasource jndi-name="java:/OperationalDS" pool-name="MpkDemoUsDS" enabled="true">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
production
</xa-datasource-property>
<driver>mysql</driver>
<security>
<user-name>k3</user-name>
<password>********</password>
</security>
<validation>
<check-valid-connection-sql>/* ping */ SELECT 1</check-valid-connection-sql>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</xa-datasource>
> Persisting new entity with cached blind-side @OneToMany CMR field fails on transaction flush.
> ---------------------------------------------------------------------------------------------
>
> Key: ISPN-3540
> URL: https://issues.jboss.org/browse/ISPN-3540
> Project: Infinispan
> Issue Type: Bug
> Affects Versions: 5.2.1.Final
> Environment: 64-bit Ubuntu 13.04, JBoss 7.2.0.Final, Hibernate 4.2.4.
> Reporter: Jari Juslin
> Assignee: Mircea Markus
>
> I have two entity beans, both transactionally cached and then n:m relationship between them. The one side maps the CMR relationship as a Set and sets it to be transactionally cached.
> Now when I create a new object on the one side, so that the Set containing the other side is empty, the transaction fails during the flush stage with the following message:
> WARN [org.infinispan.transaction.TransactionTable] (http-/0.0.0.0:8080-1:) ISPN000101: Failed synchronization registration: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
> If I leave the Set field null, it works.
> The beans:
> @Entity()
> @Table(name="k3_run")
> @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
> public class Run implements Serializable {
> private Integer id;
> private Set<Restriction> restrictions = new HashSet<>();
>
> @Id
> @GeneratedValue(strategy=GenerationType.IDENTITY)
> @Column(name = "id")
> public Integer getId() {
> return id;
> }
> public void setId(Integer id) {
> this.id = id;
> }
> @OneToMany
> @JoinColumn(name="run_fk")
> @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
> public Set<Restriction> getRestrictions() {
> return restrictions;
> }
> public void setRestrictions(Set<Restriction> restrictions) {
> this.restrictions = restrictions;
> }
> }
> @Entity
> @Table(name="k3_restriction")
> @Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
> public class Restriction {
> private Integer id;
>
> @Id
> @GeneratedValue(strategy=GenerationType.IDENTITY)
> @Column(name = "id")
> public Integer getId() {
> return id;
> }
> public void setId(Integer id) {
> this.id = id;
> }
> }
> The RESTeasy service doing the creation:
> @Stateless
> @LocalBean
> @Path("/bug_repro")
> @TransactionAttribute(TransactionAttributeType.REQUIRED)
> public class RunRest {
> @PersistenceContext(unitName = "persistence_context")
> protected EntityManager entityManager;
> @POST
> @TransactionAttribute(TransactionAttributeType.REQUIRED)
> public String createRun() {
> final Run run = new Run();
> entityManager.persist(run);
> return "New run created with ID " + run.getId();
> }
> }
> This curl command used to invoke it:
> curl -H 'Content-Type: application/xml; charset=UTF-8' -X POST http://localhost:8080/infinispan_bug_reproduction/bug_repro
> The persistence.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
> version="2.0">
> <persistence-unit name="persistence_context" transaction-type="JTA">
> <provider>org.hibernate.ejb.HibernatePersistence</provider>
> <jta-data-source>java:/OperationalDS</jta-data-source>
> <properties>
> <property name="hibernate.hbm2ddl.auto" value="validate"/>
> <property name="hibernate.cache.use_second_level_cache" value="true"/>
> <property name="hibernate.cache.use_query_cache" value="true"/>
> </properties>
> </persistence-unit>
> </persistence>
> The datasource definition:
> <xa-datasource jndi-name="java:/OperationalDS" pool-name="MpkDemoUsDS" enabled="true">
> <xa-datasource-property name="ServerName">
> localhost
> </xa-datasource-property>
> <xa-datasource-property name="DatabaseName">
> production
> </xa-datasource-property>
> <driver>mysql</driver>
> <security>
> <user-name>k3</user-name>
> <password>********</password>
> </security>
> <validation>
> <check-valid-connection-sql>/* ping */ SELECT 1</check-valid-connection-sql>
> <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
> </validation>
> </xa-datasource>
> The stacktrace:
> 17:08:50,159 WARN [org.infinispan.transaction.TransactionTable] (http-/0.0.0.0:8080-1:) ISPN000101: Failed synchronization registration: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronizationImple(TransactionImple.java:374)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.registerSynchronization(TransactionImple.java:351)
> at org.infinispan.transaction.TransactionTable.enlist(TransactionTable.java:214)
> at org.infinispan.interceptors.TxInterceptor.enlist(TxInterceptor.java:271)
> at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:245)
> at org.infinispan.interceptors.TxInterceptor.visitRemoveCommand(TxInterceptor.java:201)
> at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
> at org.infinispan.interceptors.CacheMgmtInterceptor.visitRemoveCommand(CacheMgmtInterceptor.java:137)
> at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
> at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)
> at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)
> at org.infinispan.commands.AbstractVisitor.visitRemoveCommand(AbstractVisitor.java:67)
> at org.infinispan.commands.write.RemoveCommand.acceptVisitor(RemoveCommand.java:72)
> at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)
> at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1162)
> at org.infinispan.CacheImpl.removeInternal(CacheImpl.java:308)
> at org.infinispan.CacheImpl.remove(CacheImpl.java:302)
> at org.infinispan.DecoratedCache.remove(DecoratedCache.java:325)
> at org.infinispan.AbstractDelegatingCache.remove(AbstractDelegatingCache.java:313)
> at org.hibernate.cache.infinispan.access.TransactionalAccessDelegate.remove(TransactionalAccessDelegate.java:152) [hibernate-infinispan-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.cache.infinispan.collection.TransactionalAccess.remove(TransactionalAccess.java:48) [hibernate-infinispan-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.action.internal.CollectionAction.evict(CollectionAction.java:152) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:64) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:377) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:369) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:292) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:339) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1234) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:404) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.transaction.synchronization.internal.SynchronizationCallbackCoordinatorImpl.beforeCompletion(SynchronizationCallbackCoordinatorImpl.java:113) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at org.hibernate.engine.transaction.synchronization.internal.RegisteredSynchronization.beforeCompletion(RegisteredSynchronization.java:53) [hibernate-core-4.2.4.Final.jar:4.2.4.Final]
> at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:76)
> at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:273)
> at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:93)
> at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:162)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
> at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:126)
> at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75)
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.endTransaction(CMTTxInterceptor.java:91) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:252) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:315) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:214) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54) [jboss-as-ejb3-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:165) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final.jar:1.1.1.Final]
> at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:72) [jboss-as-ee-7.2.0.Final.jar:7.2.0.Final]
> at com.ecolane.mpk.rest.RunRest$$$view2.createRun(Unknown Source) [classes:]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_40]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_40]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_40]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_40]
> at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.5.Final.jar:]
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.5.Final.jar:]
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final.jar:1.0.2.Final]
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.2.0.Final.jar:7.2.0.Final]
> at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.0.Final.jar:7.2.0.Final]
> at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 3 months
[JBoss JIRA] (ISPN-3540) Persisting new entity with cached blind-side @OneToMany CMR field fails on transaction flush.
by Jari Juslin (JIRA)
Jari Juslin created ISPN-3540:
---------------------------------
Summary: Persisting new entity with cached blind-side @OneToMany CMR field fails on transaction flush.
Key: ISPN-3540
URL: https://issues.jboss.org/browse/ISPN-3540
Project: Infinispan
Issue Type: Bug
Affects Versions: 5.2.1.Final
Environment: 64-bit Ubuntu 13.04, JBoss 7.2.0.Final, Hibernate 4.2.4.
Reporter: Jari Juslin
Assignee: Mircea Markus
I have two entity beans, both transactionally cached and then n:m relationship between them. The one side maps the CMR relationship as a Set and sets it to be transactionally cached.
Now when I create a new object on the one side, so that the Set containing the other side is empty, the transaction fails during the flush stage with the following message:
WARN [org.infinispan.transaction.TransactionTable] (http-/0.0.0.0:8080-1:) ISPN000101: Failed synchronization registration: java.lang.IllegalStateException: ARJUNA016082: Synchronizations are not allowed! Transaction status isActionStatus.RUNNING
If I leave the Set field null, it works.
The beans:
@Entity()
@Table(name="k3_run")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Run implements Serializable {
private Integer id;
private Set<Restriction> restrictions = new HashSet<>();
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToMany
@JoinColumn(name="run_fk")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public Set<Restriction> getRestrictions() {
return restrictions;
}
public void setRestrictions(Set<Restriction> restrictions) {
this.restrictions = restrictions;
}
}
@Entity
@Table(name="k3_restriction")
@Cache(usage=CacheConcurrencyStrategy.TRANSACTIONAL)
public class Restriction {
private Integer id;
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "id")
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
}
The RESTeasy service doing the creation:
@Stateless
@LocalBean
@Path("/bug_repro")
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class RunRest {
@PersistenceContext(unitName = "persistence_context")
protected EntityManager entityManager;
@POST
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public String createRun() {
final Run run = new Run();
entityManager.persist(run);
return "New run created with ID " + run.getId();
}
}
This curl command used to invoke it:
curl -H 'Content-Type: application/xml; charset=UTF-8' -X POST http://localhost:8080/infinispan_bug_reproduction/bug_repro
The persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="persistence_context" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/OperationalDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="validate"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
</properties>
</persistence-unit>
</persistence>
The datasource definition:
<xa-datasource jndi-name="java:/OperationalDS" pool-name="MpkDemoUsDS" enabled="true">
<xa-datasource-property name="ServerName">
localhost
</xa-datasource-property>
<xa-datasource-property name="DatabaseName">
production
</xa-datasource-property>
<driver>mysql</driver>
<security>
<user-name>k3</user-name>
<password>********</password>
</security>
<validation>
<check-valid-connection-sql>/* ping */ SELECT 1</check-valid-connection-sql>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</xa-datasource>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 3 months
[JBoss JIRA] (ISPN-3526) Inject dependecies into the marshaller used for compatibility mode
by Pedro Ruivo (JIRA)
[ https://issues.jboss.org/browse/ISPN-3526?page=com.atlassian.jira.plugin.... ]
Pedro Ruivo updated ISPN-3526:
------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
> Inject dependecies into the marshaller used for compatibility mode
> ------------------------------------------------------------------
>
> Key: ISPN-3526
> URL: https://issues.jboss.org/browse/ISPN-3526
> Project: Infinispan
> Issue Type: Feature Request
> Affects Versions: 6.0.0.Alpha4
> Reporter: Adrian Nistor
> Assignee: Adrian Nistor
> Fix For: 6.0.0.Beta2
>
>
> Interoperability between remote query and embedded mode requires a special marshaller to be specified (CompatibilityProtoStreamMarshaller) which has a dependency on the CacheManager. It should not be the user's responsibility to inject this dependency because that could only work with programmatic configuration and would be impossible with xml config.
> Probably the best way to solve this is to automatically wire all user provided marshaller _instances_ if they are annotated for injection.
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 3 months
[JBoss JIRA] (ISPN-3431) Lost version info during state transfer causes overwrite of newer data that joining node has read from store
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/ISPN-3431?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration commented on ISPN-3431:
-----------------------------------------------
Martin Gencur <mgencur(a)redhat.com> changed the Status of [bug 1006998|https://bugzilla.redhat.com/show_bug.cgi?id=1006998] from NEW to CLOSED
> Lost version info during state transfer causes overwrite of newer data that joining node has read from store
> ------------------------------------------------------------------------------------------------------------
>
> Key: ISPN-3431
> URL: https://issues.jboss.org/browse/ISPN-3431
> Project: Infinispan
> Issue Type: Bug
> Components: State transfer
> Affects Versions: 6.0.0.Alpha3
> Environment: uname -s ; cat /etc/redhat-release ; java -version
> Linux
> Red Hat Enterprise Linux Server release 5.9 (Tikanga)
> java version "1.6.0_30"
> Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
> Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)
> Reporter: Nikolay Martynov
> Assignee: Pedro Ruivo
> Priority: Critical
> Labels: jdg62blocker
> Fix For: 6.0.0.CR1
>
>
> When state transfer sends data to newly joining node no version information is provided despite the fact that this information is available to the cluster (for example, loaded from store). When newly joining node has loaded from its store newer version of data than cluster has then this newer version of data is overwritten because no version information is provided during state transfer.
> Scenario:
> {noformat}
> 1. Start node1, node2, node3
> 2. Put {A=>A1} from node1
> 3. Put {B=>B1} from node2
> 4. Put {C=>C1} from node3
> 5. Gracefully shutdown node1 saving the data
> 6. Gracefully shutdown node2 saving the data
> 7. Put {C=>C2} from node3
> 8. Gracefully shutdown node3 saving the data
> 9. Start node1 loading the data
> 10. Start node2 loading the data
> 11. Start node3 loading the data
> {noformat}
> Loaded from store on node3 - version information shows its newer than nodes 1 and 2 have:
> {noformat}
> org.infinispan.interceptors.CallInterceptor
> Executing command: PutKeyValueCommand{key=C, value=C2, flags=[CACHE_MODE_LOCAL, SKIP_LOCKING, SKIP_CACHE_STORE, SKIP_INDEXING, SKIP_OWNERSHIP_CHECK, IGNORE_RETURN_VALUES], putIfAbsent=false, metadata=EmbeddedMetadata{version=SimpleClusteredVersion{topologyId=8, version=2}}, successful=true, ignorePreviousValue=false}.
> {noformat}
> During state transfer older value C1 is received with version information being null:
> {noformat}
> org.infinispan.statetransfer.StateTransferInterceptor
> handleNonTxWriteCommand for command PutKeyValueCommand{key=C, value=C1, flags=[CACHE_MODE_LOCAL, SKIP_REMOTE_LOOKUP, PUT_FOR_STATE_TRANSFER, SKIP_SHARED_CACHE_STORE, SKIP_OWNERSHIP_CHECK, IGNORE_RETURN_VALUES, SKIP_XSITE_BACKUP], putIfAbsent=false, metadata=EmbeddedMetadata{version=null}, successful=true, ignorePreviousValue=false}
> {noformat}
> As a result newer value is replaced with older:
> {noformat}
> org.infinispan.interceptors.EntryWrappingInterceptor
> About to commit entry ClusteredRepeatableReadEntry(323f265b){key=C, value=C1, oldValue=C2, isCreated=false, isChanged=true, isRemoved=false, isValid=true, skipRemoteGet=true, metadata=EmbeddedMetadata{version=SimpleClusteredVersion{topologyId=8, version=2}}}
> {noformat}
> As far as i can see, any key on any node that it didnt written but has received during resync has version=null after loading from store.
> Config:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> This is just a very simplistic example configuration file. For more information, please see
> http://docs.jboss.org/infinispan/5.3/configdocs/infinispan-config-5.3.html
> -->
> <infinispan
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="urn:infinispan:config:6.0 http://docs.jboss.org/infinispan/schemas/infinispan-config-6.0.xsd"
> xmlns="urn:infinispan:config:6.0">
> <global>
> <globalJmxStatistics enabled="true" jmxDomain="Infinispan" />
> <transport>
> <properties>
> <property name="configurationFile" value="jgroups.xml" />
> </properties>
> </transport>
> </global>
> <namedCache name="routing_table">
> <clustering mode="REPL">
> <stateTransfer awaitInitialTransfer="true" fetchInMemoryState="true"/>
> <sync replTimeout="1000"/>
> <!--async useReplQueue="true" replQueueMaxElements="100" /-->
> </clustering>
> <loaders passivation="false" shared="false" preload="true">
> <singleFileStore
> location="target/routing_table${infinispan.store_name:not_specified}/">
> </singleFileStore>
> </loaders>
> <versioning enabled="true" versioningScheme="SIMPLE"/>
> <transaction
> transactionMode="TRANSACTIONAL"
> autoCommit="true"
> transactionManagerLookupClass="org.infinispan.transaction.lookup.GenericTransactionManagerLookup"
> lockingMode="OPTIMISTIC"
> />
> <locking
> writeSkewCheck="true"
> isolationLevel="REPEATABLE_READ"/>
> </namedCache>
> </infinispan>
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 3 months