Hi all,

I am using the hibernate that comes with JBoss 4.0sp1 and am having this issue 
which seems to be an EJB error rather than a hibernate error.  

I am trying to update multiple entities of the same type in one transaction in 
one session. If the transaction only has one entity that needs updating then 
everything works fine. If I do the same process as with the one entity but do 
it multiple times it fails!!

What follows are the two mapping xml files, the stacktrace, some hibernate 
generated sql and the code between sessionFactory.openSession() and 
session.close(): 

Anybody got ideas?

Cheers
Tom

Hibernate version:
Its the version with JBoss 4.0sp1
2.1.8 I think

Mapping documents: There are two documents that need consideration. A 
TransportDestination has a TransportType and a TransportType has multiple 
TransportDestinations.

TransportType:




<column name="id_transport_type" sql-type="integer" not-null="true"/>

tbltransporttype_id_transport_type_seq




<column name="transport_type" sql-type="char(64)" not-null="true"/>



<column name="session_name" sql-type="char(64)" not-null="true"/>




<one-to-many class="com.camp.common.transport.TransportDestination"/>




AND TransportDestination




<column name="id_destination" sql-type="integer" not-null="true"/>

tbltransportdestination_id_destination_seq




<column name="code" sql-type="char(3)" not-null="true"/>



<column name="name" sql-type="char(128)"/>



<column name="city" sql-type="char(128)" not-null="true"/>



<column name="state" sql-type="char(128)" not-null="true"/>



<column name="country" sql-type="char(128)" not-null="true"/>



<column name="listed" sql-type="boolean" not-null="true"/>


<many-to-one name="transportType" 
class="com.camp.common.transport.TransportType" column="fk_id_transport_type" 
not-null="true"/>




Code between sessionFactory.openSession() and session.close():
Note: _transport_destinations = java.util.List

// Open Session
sess = sf.openSession();

// Create Transaction
Transaction t = sess.beginTransaction();

TransportDestination dest;
t = sess.beginTransaction();

//repeat as many times as there are destinations in the list
for (int i = 0; i < _transport_destinations.size(); i++) {

//get the destination
dest = (TransportDestination) _transport_destinations.get(i);

if (_operation.equals(Globals.ADD))
sess.save(dest);
else if (_operation.equals(Globals.UPDATE))
sess.update(dest);
else if (_operation.equals(Globals.DELETE))
sess.delete(dest);

}
t.commit();
sess.close();


Full stack trace of any exception that occurs:
11:58:38,480 INFO [STDOUT] Hibernate: update tblTransportDestination set 
code=?, name=?, city=?, state=?, country=?, listed=?, fk_id_transport_type=? 
where id_destination=?
11:58:38,480 INFO [STDOUT] Hibernate: update tblTransportDestination set 
code=?, name=?, city=?, state=?, country=?, listed=?, fk_id_transport_type=? 
where id_destination=?
11:58:38,480 INFO [STDOUT] Hibernate: update tblTransportDestination set 
code=?, name=?, city=?, state=?, country=?, listed=?, fk_id_transport_type=? 
where id_destination=?
11:58:38,488 INFO [transportEJB] Leaving modifyTransportDestinations
11:58:38,565 ERROR [TxInterceptorBMT] Application error: BMT stateless bean 
transport should complete transactions before returning (ejb1.1 spec, 11.6.1)
11:58:38,567 WARN [RequestProcessor] Unhandled Exception thrown: class 
java.rmi.RemoteException
11:58:38,568 ERROR [Engine] StandardWrapperValve[camp]: Servlet.service() for 
servlet camp threw exception
java.rmi.RemoteException: Application error: BMT stateless bean transport 
should complete transactions before returning (ejb1.1 spec, 11.6.1)
at 
org.jboss.ejb.plugins.AbstractTxInterceptorBMT.checkStatelessDone(AbstractTxInterceptorBMT.java:208)
at 
org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:157)
at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
at 
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113)
at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:122)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
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:856)
at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at 
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at 
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
at 
org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at 
org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy84.modifyTransportDestinations(Unknown Source)
at 
com.camp.helpers.config.transport.TransportConfigHelper.modifyTransportDestinations(Unknown
 Source)
at com.camp.actions.config.TransportConfigAction.execute(Unknown Source)
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:237)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at 
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at 
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
Name and version of the database you are using:

The generated SQL (show_sql=true):
11:58:38,480 INFO [STDOUT] Hibernate: update tblTransportDestination set 
code=?, name=?, city=?, state=?, country=?, listed=?, fk_id_transport_type=? 
where id_destination=?



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3872188#3872188

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3872188


-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/info/Sentarus/hamr30
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to