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: Why the change to JTATransaction?
PostPosted: Thu Mar 23, 2006 12:16 am 
Newbie

Joined: Tue Mar 21, 2006 1:42 pm
Posts: 14
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.2

Mapping documents:

Code between sessionFactory.openSession() and session.close():

The code in question is below,

Code:
            xact = pf.beginTransaction(); // simple sessionLocal.beginTransaction()

            //- Make sure we have an ItemSet
            items = (results instanceof ItemSet) ? (ItemSet)results : pf.newItemSet(results);

            //- Initialize tracking
            WorkflowEngine.track(which, items);

            //- End the activity
            updatePreviousUser(user, pf.getActivityInstance(which));
            pf.endActivityInstance(which, items);
            pf.commit(xact); // simple call to transaction.commit()


Before the commit above, the code below is executed via the call to endActivity.

Code:
           xact = pf.beginTransaction(); // again simpe call to sessionLocal.beginTransaction()
           
           //- Copy the tag, if necessary
           if (items.getTag() == null && original.getTag() != null) {
              items.setTag(original.getTag());
           }
           
           //- Update the priority, if necessary
           if (items.getPriority() < _priority) {
               items.setPriority(_priority);
           }
           
            _items = items;
            _complete = true;
           
            //- Enable management on the new items
            _items.setManaged(true);

            pf.update(_items);
            pf.update(this);
           
            _endTime = new Long(System.currentTimeMillis());
           
            pf.commit(xact); // again, transaction.commit


Full stack trace of any exception that occurs:

Code:
2006-03-22 20:35:47,734 WARN  [com.imsweb.seerdms.app.workflow.buslogic.WorkflowWebBean] Could not commit transaction to end activity; already finished
com.imsweb.seerdms.app.workflow.base.AlreadyFinishedException: org.hibernate.TransactionException: Transaction not successfully started
   at com.imsweb.seerdms.app.workflow.hibernate.HibernatePackageFactory.commit(HibernatePackageFactory.java:876)
   at com.imsweb.seerdms.app.workflow.buslogic.WorkflowWebBean.endActivityInstance(WorkflowWebBean.java:535)
   at com.imsweb.seerdms.app.workflow.buslogic.WorkflowWebSession.endActivityInstance(WorkflowWebSession.java:399)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
   at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
   at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
   at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
   at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
   at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
   at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
   at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
   at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
   at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
   at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
   at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
   at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
   at org.jboss.ejb.Container.invoke(Container.java:873)
   at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:413)
   at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
   at $Proxy119.endActivityInstance(Unknown Source)
   at com.imsweb.seerdms.web.edit.record.DisplayRecordUtils.endResolveRecordErrorsActivity(DisplayRecordUtils.java:647)
   at com.imsweb.seerdms.web.edit.record.DisplayRecordAction.updateExit(DisplayRecordAction.java:942)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
   at com.imsweb.seerdms.web.shared.SeerAction.execute(SeerAction.java:118)
   at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
   at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
   at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
   at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
   at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
   at java.lang.Thread.run(Thread.java:595)
Caused by: org.hibernate.TransactionException: Transaction not successfully started
   at org.hibernate.transaction.JTATransaction.commit(JTATransaction.java:126)
   at com.imsweb.seerdms.app.workflow.hibernate.HibernatePackageFactory.commit(HibernatePackageFactory.java:872)
   ... 57 more


Name and version of the database you are using: Oracle 10g


I guess my question is why the change to JTATransaction between version 2.1.8 to 3.1.2? This used to work with Hibernate 2.1.8, the nesting of transactions did not cause an exception. The change in 3.1.2 is in the JTATransaction.afterCommitRollback() method, the field begun is being set to false.

_________________
Mike Ringrose


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.