-->
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.  [ 1 post ] 
Author Message
 Post subject: Could not register synchronization with JTA TransactionManag
PostPosted: Mon Dec 04, 2006 12:38 am 
Newbie

Joined: Mon Oct 11, 2004 4:08 am
Posts: 15
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0.5

Mapping documents:
<hibernate-configuration>
<session-factory>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.datasource">jdbc/adsr__pm</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.DatasourceConnectionProvider</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
:
:

Code between sessionFactory.openSession() and session.close():
Session session = null ;
Series s = null;

try {
session = getSessionFactory().openSession();

Criteria cr = session.createCriteria(Series.class);
cr.createAlias( "instrument", "i" );
cr.setFetchMode("instrument", FetchMode.JOIN);
if (instrumentId != null)
cr.add( Expression.eq("i.instrumentId", instrumentId) );
if (contractMonth > 0 && contractMonth <= 12)
cr.add( Expression.eq("contractMonth", new Integer(contractMonth)) );
if (contractYear > 0)
cr.add( Expression.eq("contractYear", new Integer(contractYear)) );
if (type != null)
cr.add( Expression.eq("type", type) );
if (strikePrice != null)
cr.add( Expression.eq("strikePrice", strikePrice) );
else
cr.add( Expression.eq("strikePrice", new Double(0)) );

// filter out the london metal future
cr.add(Expression.eq("isLondonMetalFuture", new Boolean(false)));

s = (Series)cr.uniqueResult();

if (s != null) {
Hibernate.initialize(s.getInstrument());
Hibernate.initialize(s.getInstrument().getCurrency());
}
session.flush();
} catch (Exception ex) {
// handle exception
if(logger!=null && logger.isErrorEnabled())
logger.error("Exception in getSeries ", ex);
throw getDAOException(35014, ex);
} finally {
if ( session != null && session.isOpen() ) {
try {
session.close();
session = null;
}
catch ( Exception ex ) {
// handle exception
if(logger!=null && logger.isErrorEnabled())
logger.error("Exception in getSeries ", ex);
}
}
}

Full stack trace of any exception that occurs:
2006-12-04 12:17:21,671 ERROR def.AbstractFlushingEventListener Could not synchronize database state with session
org.hibernate.TransactionException: could not register synchronization with JTA TransactionManager
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:187)
at org.hibernate.jdbc.JDBCContext.connectionOpened(JDBCContext.java:80)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:309)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:110)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:76)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:69)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:1957)
at org.hibernate.persister.entity.BasicEntityPersister.updateOrInsert(BasicEntityPersister.java:1909)
at org.hibernate.persister.entity.BasicEntityPersister.update(BasicEntityPersister.java:2149)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:75)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:239)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:223)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:137)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:274)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
at com.shkco.jaf.platform.persistence.provider.HibernateDaoSupport.saveOrUpdate(HibernateDaoSupport.java:506)
at com.shkco.adsr.staticdata.dao.hibernate.HibernateSeriesDAO.update(HibernateSeriesDAO.java:500)
at com.shkco.adsr.staticdata.domain.controller.InstrumentManager.updateSeries(InstrumentManager.java:1263)
at com.shkco.adsr.dataconversion.domain.InstrumentConvManager.convertSeries(InstrumentConvManager.java:1956)
at com.shkco.adsr.dataconversion.service.ejb.InstrumentConvServiceBean.convertSeries(InstrumentConvServiceBean.java:63)
at com.shkco.adsr.dataconversion.app.activity.SeriesConvertActivity.perform(SeriesConvertActivity.java:73)
at com.shkco.jaf.application.afc.app.control.impl.EntControllerBean.handleEvent(EntControllerBean.java:105)
at com.shkco.adsr.common.transport.controller.impl.ejb.CommandAppControllerBean.doHandleEvent(CommandAppControllerBean.java:155)
at com.shkco.adsr.common.transport.controller.impl.ejb.CommandAppControllerBean.handleTransactedEvent(CommandAppControllerBean.jav
a:85)
at com.shkco.adsr.common.transport.controller.impl.ejb.CommandAppControllerBean.handleEvent(CommandAppControllerBean.java:47)
at com.shkco.adsr.common.transport.controller.impl.ejb.CommandController_lqly3b_EOImpl.handleEvent(CommandController_lqly3b_EOImpl
.java:61)
at com.shkco.adsr.common.transport.controller.impl.ejb.CommandController_lqly3b_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: weblogic.transaction.RollbackException: Transaction timed out after 29 seconds
BEA1-64FAA1CEA82CC9463A97
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1782)
at weblogic.transaction.internal.ServerTransactionImpl.registerSynchronization(ServerTransactionImpl.java:571)
at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:176)
... 37 more
Name and version of the database you are using:
Oracle 10.0.2

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


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

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.