ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <seyhan.basm...@teb.com.tr>
Subject RE: Nested Transactions
Date Wed, 15 Mar 2006 08:42:34 GMT
Probably you can create a new  transation using autonomous  transaction
for Oracle...

 

 

________________________________

From: Jeff Butler [mailto:jeffgbutler@gmail.com] 
Sent: Tuesday, March 14, 2006 6:42 PM
To: user-java@ibatis.apache.org
Subject: Re: Nested Transactions

 

Why not do this in one transaction?

 

The ABC DAO class should not have any transaction code in it, either
should the XYZ DAO.  A service level method should do the transaction
code:

 

CreateABC -

Insert ABC

 

Create XYZ -

Insert X

Insert Y

CreateABC

Insert Z

 

XYZ Service -

Start T1

Create XYZ

Commit T1

 

Jeff Butler



 

On 3/14/06, Rashmi Dave <rashmid@persistent.co.in> wrote: 

Hi All,

I am not sure if this is a silly/obvious question, however, here goes:

I have a function called CreateABC. This starts a transaction, inserts
into 
the DB and then commits the transaction and finally stops it.

I have another function which is called CreateXYZ. This function also
does
the same thing. However, it also calls CreateABC internally since ABC
needs 
to be created as part of creation of XYZ.

CreateABC -
Start T1
Insert ABC
Commit T1

CreateXYZ -
Start T2
Insert X
Insert Y
CreateABC
Insert Z
Commit T2

What I want to know is, in case Insert Z fails, and a rollback needs to
be 
done, will ABC, X and Y get rolled back? I am using Abator generated
classes
for ibatis...

TIA

~Rashmi
 
 
Bu elektronik posta mesaji ve ekleri sadece gonderildigi kisi veya kuruma ozeldir ve gizli
bilgiler icerebilir. Eger bu mesaji hataen aldiysaniz lutfen bu durumu gonderen kisiye derhal
bildiriniz ve mesaji sisteminizden siliniz. Eger dogru kisiye ulasmadigini dusunuyorsaniz,
bu mesajin gizlenmesi, yonlendirilmesi, kopyalanmasi veya herhangi bir sekilde kullanilmasi
yasaktir. Internet iletisiminde guvenlik ve hatasiz gonderim garanti edilemeyeceginden, mesajin
yerine ulasmamasi, gec ulasmasi, iceriginin bozulmasi ya da mesajin virus tasimasi gibi problemler
olusabilir. Gonderen taraf bu tip sorunlardan sorumlu tutulmaz.

This e-mail message and any attachments are confidential and intended solely for the use of
the individual or entity to whom they are addressed. If you have received this message in
error, please notify the sender immediately and delete it from your system. If you are not
the intended recipient you are hereby notified that any dissemination, forwarding, copying
or use of any of the information is prohibited. Internet communications cannot be guaranteed
to be secure or error-free as information could be intercepted, corrupted, lost, arrive late
or contain viruses. The sender therefore does not accept liability for any errors or omissions
in the context of this message which arise as a result of Internet transmission.

Mime
View raw message