Joined: Tue Mar 07, 2006 6:54 am Posts: 2
|
Hi,
I am using Hibernate 3.0.5 on Weblogic 8.1 application server with oracle 9i as database server.
We are using the default transaction factory of hibernate i.e JDBCTransaction in the mapping file. But we get a exception whenever we are trying to commit the transaction.
code used is given below :
transaction = session.beginTransaction(); session.update(object);
session.flush(); transaction.commit();
Exception is
ERROR org.hibernate.transaction.JDBCTransaction - JDBC commit failed java.sql.SQLException: Cannot call Connection.commit in distributed transaction. Transaction Manager will commit the resource manager when the distributed transaction is committed. at weblogic.jdbc.wrapper.JTSConnection.commit(JTSConnection.java:643) at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:119) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:95) at example.HibernateUtil.update(HibernateUtil.java:111) 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:324) at com.bea.wlw.runtime.core.dispatcher.DispMethod.invoke(DispMethod.java:371) at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:433) at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:406) at com.bea.wlw.runtime.core.container.Invocable.invoke(Invocable.java:249) at com.bea.wlw.runtime.core.bean.BaseContainerBean.invokeBase(BaseContainerBean.java:224) at com.bea.wlw.runtime.core.bean.SLSBContainerBean.invoke(SLSBContainerBean.java:109) at com.bea.wlwgen.StatelessContainer_ly05hg_ELOImpl.invoke(StatelessContainer_ly05hg_ELOImpl.java:153) at com.bea.wlwgen.GenericStatelessSLSBContAdpt.invokeOnBean(GenericStatelessSLSBContAdpt.java:62) at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.runAsInvoke(BaseDispatcherBean.java:153) at com.bea.wlw.runtime.core.bean.BaseDispatcherBean.invoke(BaseDispatcherBean.java:54) at com.bea.wlw.runtime.core.bean.SyncDispatcherBean.invoke(SyncDispatcherBean.java:168) at com.bea.wlw.runtime.core.bean.SyncDispatcher_k1mrl8_EOImpl.invoke(SyncDispatcher_k1mrl8_EOImpl.java:46) at com.bea.wlw.runtime.core.dispatcher.Dispatcher.remoteDispatch(Dispatcher.java:161) at com.bea.wlw.runtime.core.dispatcher.Dispatcher.dispatch(Dispatcher.java:49) at com.bea.wlw.runtime.core.dispatcher.HttpServerHelper.executePostRequest(HttpServerHelper.java:713) at com.bea.wlw.runtime.core.dispatcher.HttpServer.doPost(HttpServer.java:49) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1072) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6985) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
I wouldnt like to use the JTATransaction's as of now and do have tested that the code works fine with the transaction type as JTA.
can any one let me know why is the problem happening and how can i get the code working with the transaction type as JDBC ?
Thanks in advance !!
_________________ Hibernate Newbie
|
|