Checking if a method called in transaction

Sometimes it’s comforting to know your method is called within a transaction.


if Thread.current['open_transactions'].nil? ||
Thread.current['open_transactions'] == 0

will do. Any better idea?

Advertisements

~ by Yi Wen on April 27, 2007.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: