[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

bdb: txn.abort/txn.commit immediately exits the txn_begin block

Yohanes Santoso

9/29/2003 12:50:00 PM

Executing txn.abort/txn.commit within a txn_begin block immediately
exits the block.

Is this the expected behaviour? If so, then it means not all the code
in the ensure block is executed, as guaranteed.


ruby 1.8, bdb 0.4.8, libdb4.1

--------------------------------------------------
require 'bdb41'
db = BDB::Env.new("testdb", BDB::CREATE|BDB::INIT_TRANSACTION|BDB::THREAD)
table = db.open_db(BDB::BTREE, "test", nil, BDB::CREATE)
db.txn_begin(table) {|txn, t|
begin
t[234]='sdfds'
rescue Exception => e
p e
ensure
puts "Aborting trans..."
txn.abort # txn.commit also produces the same result
puts "Trans aborted."
end
}
puts "Test DONE"
--------------------------------------------------

produces:

$ ruby1.8 storage_test.rb
Aborting trans...
Test DONE



YS.

2 Answers

ts

9/29/2003 12:57:00 PM

0

>>>>> "Y" == Yohanes Santoso <ysantoso@jenny-gnome.dyndns.org> writes:

Y> Is this the expected behaviour?

Yes, it''s implemented internally with catch/throw


Guy Decoux



Guy Namechanger

4/17/2010 2:34:00 AM

0


"Iarnrod" <iarnrod@yahoo.com> wrote in message
news:a3614e77-d97b-4b46-a154-14c634ea4708@b23g2000yqn.googlegroups.com...
On Apr 16, 6:07 pm, "Guy Namechanger"
<peterduncanismyn...@hotmail.com> wrote:
> "Iarnrod" <iarn...@yahoo.com> wrote in message
>
> news:a571a1fd-afe0-4b30-8487-6fcee828b74c@k41g2000yqf.googlegroups.com...
> On Apr 16, 5:32 pm, Jason Todd <janklowic...@yahoo.com> wrote:
>
>
>
> > I mEAn SHIT DAMN!! Iceland - MOTHERFUCKING ***ICELAND*** shoots up a
> > billion tons of volcanic ash up in the air and we do NOTHING!!
>
> > If Dubya was still in there we'd have BOMBED THE MOTHERFUCKING SHIT
> > OUT OF THOSE BASTARDS twice over now!! And yes, that includes BEEYORK
> > and her FUCKING SWAN DRESS....and let's be honest, we should have
> > bombed them JUST FOR SPAWNING HER!!!!!!!!
>
> > But noooooo....thanks to HUSSEIN, we don't do shit to ANYBODY anymore,
> > do we??? Hit us with nukes, explode a chem-bomb in Times Square, and
> > it just doesn't matter! He's all "Oh we can't go bombing innocent
> > women and children, I mean...we just have to wait for this thing to
> > play itself out! Now where's my mascara and lipstick, I want to look
> > pretty for my next Newsweek cover!"
>
> > FUCK THAT SHIT!! Somebody needs to go ballistic up in this bitch!!!
> > It's time to go to WAR!!
>
> > IMPEACH OBAMA!!!
> > IMPRISON KEITH OLBERMANN!!!!!
> > DRAFT CHENEY!!!!
> > TAKE BACK AMERICA!!!!!
>
> > YEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARGH!!!!!
>
> > Jason "Proud To Be An American" Todd
>
> Shows how much YOU know, you fuckin' kook! Obama has KEPT AMERICA SAFE
> from the Iceland volcano by issuing secret executive orders to blow
> the ash plume toward Europe and Russia and to keep it away from
> America. THANK YOU, President Obama, for once again KEEPING AMERICA
> SECURE.
>
> +++++++++++++++++
>
> Barry Sotero's use of Project HAARP is much wiser than the Bush/Cheney
> system of creating hurricanes.

Who is Barry Sotero?

++++++++++

oh, I doubt that.