首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网络技术 > 网络基础 >

Rails中的事宜

2012-12-21 
Rails中的事务?T2.transaction dot1 T1.newt1.save!t2 T2.newt2.save! end?当按上面的方式设置事务,则

Rails中的事务

?

T2.transaction do      t1 = T1.new    t1.save!    t2 = T2.new    t2.save! end

?当按上面的方式设置事务,则生成的语句将是

begin

? begin

? insert into t1....

? commit

? insert into t2...

commit

?

T2.transaction do  T1.transaction do    t1 = T1.new    t1.save!    t2 = T2.new    t2.save  endend

?而按上面的方式设置事务,则生成的语句将是

begin

? insert into t1....

? insert into t2...

commit

?

?

?

?

热点排行