Harald Gliebe wrote: > > Hi, > > > Ole Husgaard wrote: > > > > Hi, > > > > I'm in a little over my head here, since i don't > > use web components or know that part of the JBoss > > code well. > > > > > > > > 2) "A transaction that is started by a servlet or JSP page > > must be completed > > > before the service method returns. That is, transactions > > may not span web > > > requests from a client. Returning from the service method > > with an active > > > transaction context is an error. The web container is > > required to detect > > > this > > > error and abort the transaction." > > > > > > This has probably to be done specific for Jetty/Tomcat. Do > > they also have > > > some kind of interceptor-architecture that permits us to > > add this kind of > > > checks? > > > If I understand the tm code correctly, it would fail if the > > transaction is > > > accessed from two requests that are handled in different > > threads, so in my > > > opinion it would be a good idea to have this check added. > > > > No, the TM handles different threads associated with the same > > tx fine, and the UT I wrote is simply a thin interface to > > the TM. So from the TM and UT point of view this should be no > > problem. > > Yes, I don't doubt that! I'm talking about http requests above. > If the web container handles one http request and the Servlet > begins a UserTransaction, then this transaction will be > associated to the thread. If the transaction isn't commited or > rolled back by the servlet, it is still associated to the thread. > If this thread is reused by the web container to serve the next > request (probably from a different client) this request will > be executed in the existing transaction context (what is wrong). > Thus, the requirement of the spec is that the web container > ensures that a transaction is completed at the end of each > http-request, by rolling back any non-completed transaction. > > This should be similar to what happens in the finally-part of > TxInterceptorBMT.invoke for stateless session beans.
Ok. I do not know if the web containers do this, but if - they do not - they use thread pooling - a web component does not end a transaction you should get a javax.transaction.NotSupportedException at some time when a transaction is started, since the TM does not support nested transactions, and the transaction would stay active and still be associated with the reused thread. Best Regards, Ole Husgaard. _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development