Forte:Transaction Handling

Hi ,

Iam trying to run an independent transaction using the start task statement

transaction.beginIndependent();

sql insert into ORDER_TBL (orderId) values (:int_var) on session DBSessionSO;

if (int_var % 5 = 0) then

eventcase

postregister

start task m3(int_var) where completion = event,transaction = independent;

when m3_returnValuedo

task.part.logmgr.putline('returning m2_exceptionValue');

when m3_exceptionValuedotask.part.logmgr.putline('returning m2_exceptionValue');

end event;

endif;

if (int_var % 10 = 0) then

transaction.Abort();

else

transaction.commit();

endif;

In my start task statement if I specify that the transaction is 'independent'

then the prog hangs

but if I specify that the transaction is 'dependent'

it works fine with the expected output.

Please let me know as to where Iam going wrong.

Thanks in advance

[1344 byte] By [suppi.venkat] at [2007-11-25 20:11:13]
# 1

If it is independent, could it be that m3() is trying to access the same attributes (that are shared) or that it is accessing ORDER_TBL (or a table with a foreign key on it?)

Being independent, if it needs access to whatever resource locked by the outer transaction, it will not be able to proceed until the resource is unlocked...

TE

TravelEntity at 2007-7-4 14:41:30 > top of Java-index,Application & Integration Servers,Integration Servers...
# 2

You'll need 2 dbsessions if you want to execute two transactions in the same server on two different tasks.

A dbsession is a transactional object and a shared object so if the parent task accessed the dbsession within a transaction then the new task will wait until the parent task has completed.

this may be the cause of your deadlock.

JPINV at 2007-7-4 14:41:30 > top of Java-index,Application & Integration Servers,Integration Servers...