Page 1 of 1

Newbie problem - transaction states

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by lynn_evans >> Tue, 16 Sep 2003 15:11:33 GMT

Hi all

I am new to Jade, so please forgive my ignorance.

Can anyone tell me whether it is possible to test whether you are in a transaction state? I am using Jade 6, single user mode. Basically, I'm updating someone elses code, and they have not consistently used theirbegin Transaction and commitTransactions in get/set methods. I'm getting
lots of exceptions (and I don't know how to deal with them using handlers yet!), so I need to create a simple test to see whether it is in the middle of a transaction as I go. I have looked through all the help manuals and the developers guide, and haven't come up with anything.

Any ideas?

Thanks in advance
Lynn Evans

Re: Newbie problem - transaction states

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by kevin_alcock >> Tue, 16 Sep 2003 21:54:13 GMT

the following snippet of code checks transaction state.

if process.isInTransactionState then
// in transaction state
else
// not in transaction state
endif;

but I suggest you read the following http://www.jadeworld.com/downloads/Jade ... 030604.pdf


Kevin

Re: Newbie problem - transaction states

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by cnwjhp1 >> Wed, 17 Sep 2003 2:19:27 GMT

You might benefit from writing a pair of methods, eg goTrans using the snippet below to ensure you are in transaction state, and endTrans to ensure you are not in transaction state.

Cheers,
John P

Re: Newbie problem - transaction states

Posted: Fri Aug 07, 2009 12:25 pm
by ConvertFromOldNGs
by lynn_evans >> Wed, 17 Sep 2003 4:37:50 GMT

Thank you both for your help - it all worked, and I'm a happy little vegemite now!
I have downloaded that doc too, and will read asap.

Much appreciated
Lynn