How do trnsaction types interact

I want call an ejb that performs some stuff not in a db transaction (for speed) and some stuff in a transaction. Would the following work where one ejb calls 2 method in another ejb one which requires a transaction and one does not, or would it all run in one transaction, or is it illegal ?

ejb1.method1( )Transaction Required()

{

ejb2.method1()

ejb2.method2()

}

ejb2.method1() Trnsaction Type None

ejb2.method2() Transaction Type Required

[489 byte] By [paultaylora] at [2007-10-2 6:16:20]
# 1

> ejb1.method1( )Transaction Required()

> {

> ejb2.method1()

> ejb2.method2()

> }

>

> ejb2.method1() Trnsaction Type None

> ejb2.method2() Transaction Type Required

Do you mean NotSupported for ejb2.method1()?

AFAIK, the following should work. ejb2.method1() call will not be a part of the transaction.

The container will suspend the transaction context with the current thread and delegate the call to the method with the NotSupported transaction. When the method is completed, the container will resume the transaction.

annie79a at 2007-7-16 13:18:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

As per the docs for Required Transaction Attribute as declared for method1 of ejb1, it should pass the Transaction Context to the called bean ejb2's method1 and method2.

Do you mean to say that ejb2's method1 having transaction attribute Never will be executed

a. without any exception ?

or

b. will method1 of ejb2 wont be part of the transaction context?

Rgds,

seetesh

seteshhindlea at 2007-7-16 13:18:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

I am saying that for ejbMethod1 I want to run SQL that will run with autocommit rather than within a single transaction so that my db calls are not logged to the database trnsaction log for performance reasons and to allow me to process SQL such as 'TRUNCATE TABLE' which do not seem to be allowed within an EJBTransaction.

paultaylora at 2007-7-16 13:18:09 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...