[hibernate-issues] [Hibernate-JIRA] Assigned: (HSEARCH-640) MassIndexer/JBoss 6: Could not register synchronization for container transaction

Emmanuel Bernard (JIRA) noreply at atlassian.com
Wed Dec 8 05:36:13 EST 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-640?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Bernard reassigned HSEARCH-640:
----------------------------------------

    Assignee: Sanne Grinovero

Sanne, it seems to me that as it currently is, MassIndexere cannot work in a Java EE container (in particular in JPA mode).

Hibernate is configured so that if it needs a Tx, it goes to the TransactionManager and ask for it. If it is not there, it fails with an exception as we are in CMT mode and Hibernate should not trigger Tx start / stop.

Because MassIndexer uses session.beginTransaction(), this is exactly what is happening.
It seems that in Java EE, MassIndexer should start the Tx itself instead of delegating to Hibernate. 

Does that make sense? Or did I miss something?

If that's true then we will have to add a warning in the doc saying that MassIndexer is not supported in Java EE at least for v 3.3 because I can't see us pulling this off in a small week.

> MassIndexer/JBoss 6: Could not register synchronization for container transaction
> ---------------------------------------------------------------------------------
>
>                 Key: HSEARCH-640
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-640
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: massindexer
>    Affects Versions: 3.3.0.CR1
>         Environment: Hibernate 3.6.0.Final, JBoss 6.0.0.CR1, HSQL 1.8.0 (shipped with JBoss 6.0.0.CR1)
> Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
>            Reporter: Mario Winterer
>            Assignee: Sanne Grinovero
>            Priority: Critical
>             Fix For: 3.3.0.Final
>
>         Attachments: contacts.ear
>
>
> If a mass indexer is used inside a CMP bean in JBoss 6 to rebuild the search index, an org.hibernate.TransactionException is thrown:
> {noformat}
> 2010-12-06 14:01:30,720 ERROR [org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer]
> (Hibernate Search: collectionsloader-1) error during batch indexing:
>  : org.hibernate.TransactionException: Could not register synchronization for container transaction
> 	at org.hibernate.transaction.CMTTransaction.begin(CMTTransaction.java:76) [:3.6.0.Final]
> 	at org.hibernate.ejb.transaction.JoinableCMTTransaction.begin(JoinableCMTTransaction.java:89) [:3.6.0.Final]
> 	at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473) [:3.6.0.Final]
> 	at org.hibernate.search.batchindexing.EntityConsumerLuceneworkProducer.run(EntityConsumerLuceneworkProducer.java:90) [:3.3.0.CR1]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_20]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_20]
> 	at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]
> {noformat}
> I've included an example EAR (see attachment) that can be deployed to JBoss 6.0.0.CR1 without any modifications.
> It contains the required hibernate search libraries and defines one single indexed entity bean {{Contact}} as well as a JBoss service EJB named {{at.mw.contacts:ContactsService}} that can be accessed via JMX console.
> Use this service to do one of the following things:
> * add new contacts by specifying firstName/lastName
> * list all contacts
> * search for contacts using the search index
> * rebuild the entire search index (using a MassIndexer)
> Rebuilding the index fails with the exception listed above.
> Sources included.
> (the example uses an in-memory HSQL-DB and the ram directory provider for the lucene index).
> (see also forum discussion: [Could not register synchronization for container transaction|https://forum.hibernate.org/viewtopic.php?f=9&t=1004515&start=0])

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list