-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Illegal tx status
PostPosted: Mon Nov 01, 2004 11:51 am 
Newbie

Joined: Thu Feb 26, 2004 7:29 am
Posts: 17
hi all,
i've got jboss (3.2.3) and hibernate (2.1.2) in a clustered environment with jboss tree cache as the second level cache.

however, when i try to do an insert i get an exception as follows :

Code:
2004-11-01 14:36:49,766 INFO  [TP-Processor4] org.jboss.logging.util.LoggerStream Hibernate: insert into hbm_country (countryCode, countryPrefix, language, timezone, id) values (?, ?, ?, ?, ?)
2004-11-01 14:36:49,987 DEBUG [TP-Processor4] org.jboss.cache.TreeCache$SynchronizationHandler beforeCompletion(). Illegal tx status: 0
2004-11-01 14:36:50,195 ERROR [TP-Processor4] org.jboss.ejb.plugins.LogInterceptor TransactionRolledbackLocalException
in method: public abstract com.yahoo.gmmh.vo.management.ManagementVO com.yahoo.gmmh.ejb.management.interfaces.ManagementManagerLocal.acceptMessage(com.yahoo.gmmh.vo.management.ManagementVO), causedBy:
org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=codea.lon.yahoo.com//149, BranchQual=] status=STATUS_NO_TRANSACTION; - nested throwable:
(org.jboss.util.NestedRuntimeException: ; - nested throwable: (java.lang.IllegalStateException: Illegal status: 0))



my jboss-service.xml is :

Code:
<server>
   <mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateGMMH">
       <depends>jboss.jca:service=RARDeployer</depends>
       <depends>jboss.jca:service=LocalTxCM,name=cjdbc-gmmhDS</depends>
       <attribute name="MapResources">com/yahoo/gmmh/hibernate/PackageType.hbm.xml</attribute>
       <attribute name="JndiName">java:/hibernate/gmmh</attribute>
       <attribute name="Datasource">java:/cjdbc-gmmhDS</attribute>
       <attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
       <attribute name="UseOuterJoin">true</attribute>
       <attribute name="ShowSql">true</attribute>
       <attribute name="UserTransactionName">UserTransaction</attribute>
       <attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
       <attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
       <attribute name="CacheProvider">net.sf.hibernate.cache.TreeCacheProvider</attribute>
   </mbean>
</server>


relevant code is :
Code:
sess = sessionFactory.openSession();
(i'm using the ThreadLocal pattern)

insert the object, then

sess.flush();



i've the cache concurrency strategy set to 'transactional', (using xdoclet)

Code:
* @hibernate.cache  usage="transactional"


since i'm using a managed transaction i'm not explicitly opening and commiting a transaction (is this correct?) but even if i do explicitly open the transaction i still get the same exception.

can anybody see what i'm doing wrong??
any help appreciated.

cheers,
colum.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 05, 2004 6:27 am 
Newbie

Joined: Thu Feb 26, 2004 7:29 am
Posts: 17
problem was caused due to using the find() method to access the data instead of a Query ojbect.
all working now. :-)

cheer,s
colum.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.