Skip to main content

TransactionRolledbackLocalException using JPA And Glassfish 3.1.2

4 replies [Last post]
oslinux
Offline
Joined: 2013-01-08
Points: 0

I've got a problem on an application developed using Glassfish 3.1.2 + JPA + EclipseLink + MySQL, Immediately after i deploy the application (No tables on DB) it runs just fine and apparently executes the only query (Count entities in table) that i entered.
But if i reload the page, calling the servlet again causes an exception to be thrown:
TransactionRolledbackLocalException

Apparently on the same method used to count entities.

Then if i reload again, it runs just fine, then again exception, fine, exception and so on...

This is my servlet:

@WebServlet(name="Controller", urlPatterns={"/Controller"})
    public class Controller extends HttpServlet {
    private static final long serialVersionUID = 1L;

    @EJB WineDao _wines;
  
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
   
    _wines.countWines();
   
    RequestDispatcher view = request.getRequestDispatcher("ShowAll.jsp");

    view.forward(request, response);
    }
    }

This is WineDao:

    @Stateless
    public class WineDao {
    @PersistenceContext private EntityManager em;
   
    public Long countWines() {
    CriteriaBuilder qb = em.getCriteriaBuilder();
    CriteriaQuery<Long> cq = qb.createQuery(Long.class);
    cq.select(qb.count(cq.from(Wine.class)));
    return em.createQuery(cq).getSingleResult();
    }
   
    }

persistence.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="myPU" transaction-type="JTA">
    <jta-data-source>jdbc/MySQLDataSource</jta-data-source>
    <properties>
    <!-- drop and create tables at deployment -->
            <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
            <!-- log sqls executed in server.log -->
            <property name="eclipselink.logging.level" value="FINE"/>
            <!-- Instruct EclipseLink to not log execeptions it throws. Lets the application decide about it-->
            <property name="eclipselink.logging.exceptions" value="true"/>
            </properties>
    </persistence-unit>
    </persistence>

And finally the server log, when i get no errors:

    [#|2013-01-07T18:32:27.271+0100|FINE|glassfish3.1.2|org.eclipse.persistence.session.file:/opt/glassfish/glassfish/domains/domain1/applications/appname/WEB-INF/classes/_myPU.sql|_ThreadID=21;_ThreadName=Thread-2;ClassName=null;MethodName=null;|SELECT COUNT(ID) FROM Wine|#]

And when i get the error:

    [#|2013-01-07T18:32:29.582+0100|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=20;_ThreadName=Thread-2;|EJB5184:A system exception occurred during an invocation on EJB WineDao, method: public java.lang.Long it.vitux.java.appname.dao.WineDao.countWines()|#]
   
    [#|2013-01-07T18:32:29.583+0100|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=20;_ThreadName=Thread-2;|javax.ejb.TransactionRolledbackLocalException: Client's transaction aborted
    at com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:4722)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4601)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1914)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
    at $Proxy516.countWines(Unknown Source)
    at it.vitux.java.appname.dao.__EJB31_Generated__WineDao__Intf____Bean__.countWines(Unknown Source)
    at it.vitux.java.appname.controllers.Controller.doGet(Controller.java:43)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ajp.AjpProcessorTask.invokeAdapter(AjpProcessorTask.java:125)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:679)
    |#]
   
    [#|2013-01-07T18:32:29.591+0100|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=20;_ThreadName=Thread-2;|StandardWrapperValve[Controller]: PWC1406: Servlet.service() for servlet Controller threw exception
    javax.ejb.EJBTransactionRolledbackException
    at com.sun.ejb.containers.BaseContainer.mapLocal3xException(BaseContainer.java:2314)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2096)
    at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
    at $Proxy516.countWines(Unknown Source)
    at it.vitux.java.appname.dao.__EJB31_Generated__WineDao__Intf____Bean__.countWines(Unknown Source)
    at it.vitux.java.appname.controllers.Controller.doGet(Controller.java:43)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
    at com.sun.grizzly.http.ajp.AjpProcessorTask.invokeAdapter(AjpProcessorTask.java:125)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:679)
    Caused by: javax.ejb.TransactionRolledbackLocalException: Client's transaction aborted
    at com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:4722)
    at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4601)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1914)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
    ... 31 more
    |#]

Forgot the Wine class:

    @Entity
    public class Wine {
    public static final int UP_ADDED = 0;
    public static final int UP_REMOVED = 1;
    public static final int UP_PRICE = 2;
    public static final int UP_OFFER = 3;
   
    @Id Long id;
    private String name;
    private BigDecimal price;
    private BigDecimal offer;
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;
    private int updateStatus = 0;
   
    // Getters + Setters
    }

What's causing the transaction to roll back?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mvatkina
Offline
Joined: 2005-04-04
Points: 0

How do you manage transactions in your servlet? The exceptions say that
you are trying (over and over again) to invoke an EJB in a transaction
that was marked for rollback.

-marina

On 1/8/13 6:11 AM, forums@java.net wrote:
> I've got a problem on an application developed using Glassfish 3.1.2 +
> JPA +
> EclipseLink + MySQL, Immediately after i deploy the application (No
> tables on
> DB) it runs just fine and apparently executes the only query (Count
> entities
> in table) that i entered. But if i reload the page, calling the
> servlet again
> causes an exception to be thrown: TransactionRolledbackLocalException
> Apparently on the same method used to count entities. Then if i reload
> again,
> it runs just fine, then again exception, fine, exception and so on...
> This is
> my servlet: @WebServlet(name="Controller", urlPatterns={"/Controller"})
> public class Controller extends HttpServlet { private static final long
> serialVersionUID = 1L; @EJB WineDao _wines; protected void
> doGet(HttpServletRequest request, HttpServletResponse response) throws
> ServletException, IOException { _wines.countWines(); RequestDispatcher
> view =
> request.getRequestDispatcher("ShowAll.jsp"); view.forward(request,
> response);
> } } This is WineDao: @Stateless public class WineDao {
> @PersistenceContext
> private EntityManager em; public Long countWines() { CriteriaBuilder qb =
> em.getCriteriaBuilder(); CriteriaQuery cq = qb.createQuery(Long.class);
> cq.select(qb.count(cq.from(Wine.class))); return
> em.createQuery(cq).getSingleResult(); } } persistence.xml: <?xml
> version="1.0" encoding="UTF-8"?> jdbc/MySQLDataSource And finally the
> server
> log, when i get no errors:
> [#|2013-01-07T18:32:27.271+0100|FINE|glassfish3.1.2|org.eclipse.persistence.session.file:/opt/glassfish/glassfish/domains/domain1/applications/appname/WEB-INF/classes/_myPU.sql|_ThreadID=21;_ThreadName=Thread-2;ClassName=null;MethodName=null;|SELECT
>
> COUNT(ID) FROM Wine|#] And when i get the error:
> [#|2013-01-07T18:32:29.582+0100|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=20;_ThreadName=Thread-2;|EJB5184:A
>
> system exception occurred during an invocation on EJB WineDao, method:
> public
> java.lang.Long it.vitux.java.appname.dao.WineDao.countWines()|#]
> [#|2013-01-07T18:32:29.583+0100|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=20;_ThreadName=Thread-2;|javax.ejb.TransactionRolledbackLocalException:
>
> Client's transaction aborted at
> com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:4722)
> at
> com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4601)
> at
> com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1914) at
>
> com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
>
> at
> com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
>
> at $Proxy516.countWines(Unknown Source) at
> it.vitux.java.appname.dao.__EJB31_Generated__WineDao__Intf____Bean__.countWines(Unknown
>
> Source) at
> it.vitux.java.appname.controllers.Controller.doGet(Controller.java:43) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:668) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:770) at
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
>
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
> at
> com.sun.grizzly.http.ajp.AjpProcessorTask.invokeAdapter(AjpProcessorTask.java:125)
>
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045) at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
>
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>
> at java.lang.Thread.run(Thread.java:679) |#]
> [#|2013-01-07T18:32:29.591+0100|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=20;_ThreadName=Thread-2;|StandardWrapperValve[Controller]:
>
> PWC1406: Servlet.service() for servlet Controller threw exception
> javax.ejb.EJBTransactionRolledbackException at
> com.sun.ejb.containers.BaseContainer.mapLocal3xException(BaseContainer.java:2314)
>
> at
> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2096)
> at
> com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1994)
> at
> com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:222)
>
> at
> com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
>
> at $Proxy516.countWines(Unknown Source) at
> it.vitux.java.appname.dao.__EJB31_Generated__WineDao__Intf____Bean__.countWines(Unknown
>
> Source) at
> it.vitux.java.appname.controllers.Controller.doGet(Controller.java:43) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:668) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:770) at
> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>
> at
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
>
> at
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
>
> at
> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
> at
> com.sun.grizzly.http.ajp.AjpProcessorTask.invokeAdapter(AjpProcessorTask.java:125)
>
> at
> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746) at
> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045) at
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
>
> at
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
>
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
>
> at
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
>
> at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at
> com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
>
> at
> com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
>
> at java.lang.Thread.run(Thread.java:679) Caused by:
> javax.ejb.TransactionRolledbackLocalException: Client's transaction
> aborted
> at
> com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:4722)
> at
> com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4601)
> at
> com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1914) at
>
> com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
>
> ... 31 more |#] Forgot the Wine class: @Entity public class Wine { public
> static final int UP_ADDED = 0; public static final int UP_REMOVED = 1;
> public
> static final int UP_PRICE = 2; public static final int UP_OFFER = 3;
> @Id Long
> id; private String name; private BigDecimal price; private BigDecimal
> offer;
> @Temporal(TemporalType.TIMESTAMP) private Date updateTime; private int
> updateStatus = 0; // Getters + Setters } What's causing the
> transaction to
> roll back?
>
> --
>
> [Message sent by forum member 'oslinux']
>
> View Post: http://forums.java.net/node/893688
>
>

oslinux
Offline
Joined: 2013-01-08
Points: 0

I finally found a solution restarting glassfish domain -.- that's odd after a day of tries.

tmcerwin
Offline
Joined: 2010-07-26
Points: 0

Has anyone found a solution to this Glassfish issue? I am having this exception come up intermittently and I have been unable to reliably reproduce the error. I am using Glassfish version 3.2.2. A Glassfish restart fixes the problem, but it starts up again after a few days.

I am finding several threads online with others having this issue, but no resolutions.

[#|2013-04-30T09:55:19.402-0700|WARNING|glassfish3.1.2|javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=26;_ThreadName=Thread-2;|javax.ejb.TransactionRolledbackLocalException: Client's transaction aborted
at com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:4722)
at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4601)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1914)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:205)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:79)
at $Proxy267.query(Unknown Source)
at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie.dispatchToMethod(ReflectiveTie.java:144)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:174)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:528)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:199)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1624)
at com.sun.corba.ee.impl.protocol.SharedCDRClientRequestDispatcherImpl.marshalingComplete(SharedCDRClientRequestDispatcherImpl.java:126)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:273)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:200)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:227)

mvatkina
Offline
Joined: 2005-04-04
Points: 0

My only guess is that transaction was marked for rollback but never completed (somehow) when the thread was returned to the pool. The EJB container doesn't know if it's the 1st call on the thread or a subsequent call that has been dispatched to the container. So it reacts to the situation on hand - a transaction marked for rollback on the thread of execution. After that all CMT EJB calls on that thread would fail for the same reason :(.

A similar problem was reported for the EJB timers, though they use a different thread pool (that's why I'm guessing your scenario).

You can try to enable 'ejb-container' and 'jta' logging to FINE level and see if you can determine the exact scenario that causes the problem. If you do, it would be extremely helpful (none of our tests fails in that way).

thanks,
-marina