On Sat, Mar 20, 2004 at 02:08:04PM -0600, [EMAIL PROTECTED] wrote:
> ----- Forwarded message from Michael Forster <[EMAIL PROTECTED]> -----
> 
> We have a Sessionbean that is being used as a facade between the JSP server
> and the Bean server, however when we instantiate the Session we get the
> following errors
> 
> INFO EJB Daemon [3] Transaction - TX_RequiresNew: Suspended transaction null
> INFO EJB Daemon [3] Transaction - TX_RequiresNew: Started transaction
> [EMAIL PROTECTED]
> INFO EJB Daemon [3] Transaction - TX_RequiresNew: Committing transaction
> [EMAIL PROTECTED]
> ERROR EJB Daemon [3] Transaction -
> java.lang.RuntimeException: JDBC driver failed to commit transaction.
> Invalid transaction context. No active transaction
[snip]

> our ejb-jar.xml file is as follows.
> 
>      <session>
>       <ejb-name>SessionManagerBean</ejb-name>
>       <home>com.ingotz.j2ee.ejb.SessionManagerHome</home>
>       <remote>com.ingotz.j2ee.ejb.SessionManager</remote>
>       <ejb-class>com.ingotz.j2ee.ejb.SessionManagerBean</ejb-class>
>       <session-type>Stateless</session-type>
>       <transaction-type>Container</transaction-type>
>     </session>

> Can anyone enlighten me as to how to stop the errors.
> (I have tried Required, Never, Supports, all with no luck either)

If you don't need a TX around the bean call, you could switch the bean
to be a bean-managed TX bean, then cut the assembly-descriptor section
out all together.

So something like this:

      <session>
       <ejb-name>SessionManagerBean</ejb-name>
       <home>com.ingotz.j2ee.ejb.SessionManagerHome</home>
       <remote>com.ingotz.j2ee.ejb.SessionManager</remote>
       <ejb-class>com.ingotz.j2ee.ejb.SessionManagerBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Bean</transaction-type>
     </session>

Then the container is not going to try and enforce any particular
transaction rules other than checking to see if you started a
transaction but did not commit it (that's a no-no for stateless
session beans).

Give that a try and let us know how it goes.

-David

Reply via email to