[JBoss JIRA] (ISPN-1785) BatchingInterceptor is trying to resume a transaction that is in prepared state
by Luciano Leggieri (JIRA)
Luciano Leggieri created ISPN-1785:
--------------------------------------
Summary: BatchingInterceptor is trying to resume a transaction that is in prepared state
Key: ISPN-1785
URL: https://issues.jboss.org/browse/ISPN-1785
Project: Infinispan
Issue Type: Bug
Components: Core API
Affects Versions: 5.1.0.FINAL
Environment: Happens on Mac and Windows, with Java 6 and Java 7. The project uses Spring 3.1, Hibernate 4.0.1 through JPA 2, Apache Derby 10.8 as XADatasource, ActiveMQ JMS 5.1 as XA, Atomikos JTA version 3.7, Hibernate Search 4.0.0, Infinispan 5.1 Final is also enlisted as XA, it's used for Hibernate's second level cache, and as Lucene Directory for Hibernate Search.
Reporter: Luciano Leggieri
Assignee: Manik Surtani
Priority: Minor
When the Spring AppContext starts, the EntityManager bean initializes, which inits Hibernate Search, and this one inits Infinispan's Lucene Directory.
The Directory initializes Lucene Index and closes it. In this moment, org.infinispan.batch.BatchContainer ends the batch, which was running a micro transactions, so it commits the transaction.
The JTA sends a Prepare message to Infinispan XA. org.infinispan.interceptors.BatchingInterceptor receives the Prepare command and checks if there is an ongoing transaction. The transactionManager returns null because the transaction is not active but in prepare phase, so the BatchingInterceptor believes that the transaction is suspended and tries to resume it.
Exception does not seem to happen if Infinispan uses JTA synchronization instead of XAresource, although in that case there is no recovery.
Here is the stack trace:
10:01:51,964 ERROR TransactionCoordinator:154 - Error while processing prepare
java.lang.IllegalStateException: Transaction no longer active
at com.atomikos.icatch.imp.TxTerminatedStateHandler.addSubTxAwareParticipant(TxTerminatedStateHandler.java:95)
at com.atomikos.icatch.imp.CompositeTransactionImp.addSubTxAwareParticipant(CompositeTransactionImp.java:260)
at com.atomikos.icatch.imp.BaseTransactionManager.restoreThreadMappings(BaseTransactionManager.java:168)
at com.atomikos.icatch.imp.BaseTransactionManager.resume(BaseTransactionManager.java:393)
at com.atomikos.icatch.jta.TransactionManagerImp.resume(TransactionManagerImp.java:399)
at com.atomikos.icatch.jta.UserTransactionManager.resume(UserTransactionManager.java:204)
at org.infinispan.interceptors.BatchingInterceptor.handleDefault(BatchingInterceptor.java:54)
at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:113)
at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:131)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345)
at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:140)
at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:122)
at org.infinispan.transaction.xa.TransactionXaAdapter.commit(TransactionXaAdapter.java:122)
at com.atomikos.datasource.xa.XAResourceTransaction.commit(XAResourceTransaction.java:784)
at com.atomikos.icatch.imp.CommitMessage.send(CommitMessage.java:73)
at com.atomikos.icatch.imp.PropagationMessage.submit(PropagationMessage.java:111)
at com.atomikos.icatch.imp.Propagator$PropagatorThread.run(Propagator.java:87)
at com.atomikos.icatch.imp.Propagator.submitPropagationMessage(Propagator.java:66)
at com.atomikos.icatch.imp.CoordinatorStateHandler.commit(CoordinatorStateHandler.java:614)
at com.atomikos.icatch.imp.ActiveStateHandler.commit(ActiveStateHandler.java:289)
at com.atomikos.icatch.imp.CoordinatorImp.commit(CoordinatorImp.java:863)
at com.atomikos.icatch.imp.CoordinatorImp.terminate(CoordinatorImp.java:1157)
at com.atomikos.icatch.imp.CompositeTerminatorImp.commit(CompositeTerminatorImp.java:92)
at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:236)
at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:464)
at com.atomikos.icatch.jta.UserTransactionManager.commit(UserTransactionManager.java:175)
at org.infinispan.batch.BatchContainer.resolveTransaction(BatchContainer.java:123)
at org.infinispan.batch.BatchContainer.endBatch(BatchContainer.java:105)
at org.infinispan.batch.BatchContainer.endBatch(BatchContainer.java:86)
at org.infinispan.CacheImpl.endBatch(CacheImpl.java:577)
at org.infinispan.lucene.InfinispanIndexOutput.close(InfinispanIndexOutput.java:211)
at org.apache.lucene.store.ChecksumIndexOutput.close(ChecksumIndexOutput.java:61)
at org.apache.lucene.index.SegmentInfos.finishCommit(SegmentInfos.java:901)
at org.apache.lucene.index.IndexWriter.finishCommit(IndexWriter.java:3516)
at org.apache.lucene.index.IndexWriter.commitInternal(IndexWriter.java:3506)
at org.apache.lucene.index.IndexWriter.closeInternal(IndexWriter.java:1882)
at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1825)
at org.apache.lucene.index.IndexWriter.close(IndexWriter.java:1789)
at org.hibernate.search.store.impl.DirectoryProviderHelper.initializeIndexIfNeeded(DirectoryProviderHelper.java:160)
at org.hibernate.search.infinispan.impl.InfinispanDirectoryProvider.start(InfinispanDirectoryProvider.java:88)
at org.hibernate.search.indexes.impl.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:93)
at org.hibernate.search.indexes.impl.IndexManagerHolder.createDirectoryManager(IndexManagerHolder.java:193)
at org.hibernate.search.indexes.impl.IndexManagerHolder.buildEntityIndexBinding(IndexManagerHolder.java:113)
at org.hibernate.search.spi.SearchFactoryBuilder.initDocumentBuilders(SearchFactoryBuilder.java:373)
at org.hibernate.search.spi.SearchFactoryBuilder.buildNewSearchFactory(SearchFactoryBuilder.java:224)
at org.hibernate.search.spi.SearchFactoryBuilder.buildSearchFactory(SearchFactoryBuilder.java:142)
at org.hibernate.search.event.impl.FullTextIndexEventListener.initialize(FullTextIndexEventListener.java:129)
at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:82)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:294)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:257)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:530)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:496)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:657)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:630)
at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:150)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessPropertyValues(PersistenceAnnotationBeanPostProcessor.java:339)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4521)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5004)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:4999)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months
[JBoss JIRA] (ISPN-2057) Allow storage of Lucene indexes in an indexed cache
by Sanne Grinovero (JIRA)
Sanne Grinovero created ISPN-2057:
-------------------------------------
Summary: Allow storage of Lucene indexes in an indexed cache
Key: ISPN-2057
URL: https://issues.jboss.org/browse/ISPN-2057
Project: Infinispan
Issue Type: Enhancement
Components: Lucene Directory, Querying
Reporter: Sanne Grinovero
Assignee: Sanne Grinovero
Fix For: 5.2.0.ALPHA1
I think it should be better to keep them using separate caches, still it's easier for many cases in which top efficiency is not required to allow this.
(Today you'd get an exception similar to:
{quote}
java.lang.IllegalArgumentException: Indexing only works with entries keyed on Strings, primitives and classes that have the @Transformable annotation - you passed in a class org.infinispan.lucene.FileListCacheKey.{quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months
[JBoss JIRA] (ISPN-2032) MarshalledValue improvements
by Manik Surtani (JIRA)
Manik Surtani created ISPN-2032:
-----------------------------------
Summary: MarshalledValue improvements
Key: ISPN-2032
URL: https://issues.jboss.org/browse/ISPN-2032
Project: Infinispan
Issue Type: Enhancement
Components: Core API, Marshalling
Affects Versions: 5.1.4.FINAL
Reporter: Manik Surtani
Assignee: Galder Zamarreño
Fix For: 5.1.x, 5.2.0.ALPHA1, 5.2.0.FINAL
Improve MarshalledValues by using custom streams (instead of ExposedByteArrayOutputStream) which incurs a penalty of the JDK's BAOS constructor when allocating the initial byte array which is then thrown away. This patch also changes the signature of getRaw() to return the reusable buffer and prevent an unnecessary array copy.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months
[JBoss JIRA] (ISPN-1948) Invalid magic number
by Michal Linhard (JIRA)
Michal Linhard created ISPN-1948:
------------------------------------
Summary: Invalid magic number
Key: ISPN-1948
URL: https://issues.jboss.org/browse/ISPN-1948
Project: Infinispan
Issue Type: Bug
Affects Versions: 5.1.3.CR1
Reporter: Michal Linhard
Assignee: Galder Zamarreño
Here we have the good old "invalid magic number" problem again (JDG 6.0.0.ER5 testing):
https://hudson.qa.jboss.com/hudson/view/EDG6/view/EDG-REPORTS-RESILIENCE/...
{code}
2012-03-26 15:18:43,524 253444 ERROR [org.jboss.smartfrog.edg.loaddriver.DriverNode] (Client-477:) Error doing PUT(key410977) to node node02 (lastOpTime 1 ms)
org.infinispan.client.hotrod.exceptions.InvalidResponseException:: Invalid magic number. Expected 0xa1 and received 0x0
at org.infinispan.client.hotrod.impl.protocol.Codec10.readHeader(Codec10.java:92)
at org.infinispan.client.hotrod.impl.operations.HotRodOperation.readHeaderAndValidate(HotRodOperation.java:78)
at org.infinispan.client.hotrod.impl.operations.AbstractKeyValueOperation.sendPutOperation(AbstractKeyValueOperation.java:72)
at org.infinispan.client.hotrod.impl.operations.PutOperation.executeOperation(PutOperation.java:52)
at org.infinispan.client.hotrod.impl.operations.PutOperation.executeOperation(PutOperation.java:41)
at org.infinispan.client.hotrod.impl.operations.RetryOnFailureOperation.execute(RetryOnFailureOperation.java:68)
at org.infinispan.client.hotrod.impl.RemoteCacheImpl.put(RemoteCacheImpl.java:219)
at org.infinispan.CacheSupport.put(CacheSupport.java:52)
at org.jboss.qa.edg.adapter.HotRodAdapter$HotRodRemoteCacheAdapter.put(HotRodAdapter.java:249)
at org.jboss.qa.edg.adapter.HotRodAdapter$HotRodRemoteCacheAdapter.put(HotRodAdapter.java:234)
at org.jboss.smartfrog.edg.loaddriver.DriverNodeImpl$ClientThread.makeRequest(DriverNodeImpl.java:244)
at org.jboss.smartfrog.edg.loaddriver.DriverNodeImpl$ClientThread.run(DriverNodeImpl.java:375)
{code}
The exception repeats many times in the log and the "received" part of "Expected 0xa1 and received 0xXX" takes on different values.
Also happens in both PUT and GET operations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months
[JBoss JIRA] Created: (ISPN-1346) Transactional listeners method order problem
by Tomas Fecko (JIRA)
Transactional listeners method order problem
--------------------------------------------
Key: ISPN-1346
URL: https://issues.jboss.org/browse/ISPN-1346
Project: Infinispan
Issue Type: Bug
Components: Listeners
Affects Versions: 5.0.0.FINAL
Environment: fedora, windows
Reporter: Tomas Fecko
Assignee: Manik Surtani
I'm using listeners as from the @Listener javadoc examples. When I register listener on VM where the cache is and put items to it, the methods of my listener are called in this order:
@TransactionRegistered
startTransaction
@CacheEntryCreated
handleEvent
@CacheEntryCreated
handleEvent
@TransactionCompleted
endTransaction
which is as it should be, but when I register listener on second node, and put to cache in first node, methods on listener on second node are called in order:
handleEvent
handleEvent
startTransaction
endTransaction
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months
[JBoss JIRA] Created: (ISPN-800) Infinispan inside OSGI
by luca stancapiano (JIRA)
Infinispan inside OSGI
----------------------
Key: ISPN-800
URL: https://jira.jboss.org/browse/ISPN-800
Project: Infinispan
Issue Type: Feature Request
Components: Core API
Affects Versions: 4.2.0.CR1
Reporter: luca stancapiano
Assignee: Manik Surtani
We need to import infinispan inside a OSGI repository. Tests are made with Felix.
I added the configuration to use infinispan inside a osgi repository. We need to ignore all listed dependencies. With this configuration we can install infinispan-core.jar inside OSGI. Its achievement will be as a base installation here: https://github.com/flashboss/infinispan
I added the Import-Package because you are forced to put manually in Felix all dependencies as jgroups, jboss marshalling, jcip, all apache commons. I've seen infinispan core working by default without all those libraries, so I think the same achievement should be replicated in OSGI.
Inside the Import-Package tag I excluded those libraries so Infinispan core can be started in default mode without errors. If we want use the replication in OSGI, it is enough add manually the other packages (jgroups.jar etc etc)
Actually the core bundle can be installed. But to be used it needs theese projects be installed as osgi bundles:
jboss transaction api 1.0.1.GA
(It is not yet a OSGI bundle. Waiting for a response to: https://jira.jboss.org/browse/JBEE-67)
jgroups 2.10.1.GA
(fixed in jgroups 1.12)
river 1.2.3.GA
marshalling-api 1.2.3.GA
jboss common core 2.2.14.GA
jboss logging spi 2.0.5.GA
rhq plugin annotations 1.4.0.B01
i18nlog 1.0.9
log4j 1.2.16
We should make sure proper 'Import-Package' property is specified in the MANIFEST.MF so that:
1- it fails to load obviously when there's any missing bundles that are essential in using the very core functionality of Infinispan.
2 - it does not fail due to the dependency that is not really essential.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months
[JBoss JIRA] Created: (ISPN-1195) Rehashing and state transfer to use digesting
by Manik Surtani (JIRA)
Rehashing and state transfer to use digesting
---------------------------------------------
Key: ISPN-1195
URL: https://issues.jboss.org/browse/ISPN-1195
Project: Infinispan
Issue Type: Feature Request
Components: Distributed Cache, State transfer
Affects Versions: 5.0.0.FINAL
Reporter: Manik Surtani
Assignee: Dan Berindei
Priority: Critical
Fix For: 5.1.0.BETA1, 5.1.0.Final
Rather than pushing entire state to new joiners, a mechanism of digests should be used to minimise network transfers. For example, Merkle trees can be used to determine which entries are out of date and need pushing, in the case of nodes that persist to a local cache store, and is restarted but still has access to some state on disk.
This would require versioned entries though.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 4 months