You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by fanyun <yu...@vtradex.com> on 2001/06/01 03:57:11 UTC

how to use beginTransaction...

Hi:

I am now using tdk1.1a13.

When I begin my project, I worked on mysql and have not consider anything about transaction, commit and rollback.  Now I migration to oracle and plan to use transactions.

	
The problem is I find that if I want to use  beginTransaction, I have to change all the 
	
	doInsert(crit)  to  doInsert(crit, dbcon)

and so do the  doUpdate, doDelete functions.


It is quite a big work.  I wonder:  

1. is my understanding correct?  or I am wrong, no such change needed

2. if so, Any suggestion to reduce the migration work?

3. Or has the latest version have some improvement to avoid such kind of issues?




Regards&Thanks

fanyun

Re: how to use beginTransaction...

Posted by John McNally <jm...@collab.net>.
You are correct that you have to make the switch.  But changing (crit)
to (crit, dbcon) is not the largest portion of the work.  You have to
analyze where it makes sense to use a transaction.  You have to
implement the conditional or try/catch blocks where they make sense.

It is possible to use the methods in om/peer objects when
complexObjectModel=true to assemble collections of related objects,
operate on them, and then insert/update the rows in the db with a single
save() or save(dbName) on the containing object.  This will result in
the changes all occuring within a single transaction.  This is simpler,
but not when converting an existing app.

john mcnally


fanyun wrote:
> 
> Hi:
> 
> I am now using tdk1.1a13.
> 
> When I begin my project, I worked on mysql and have not consider anything about transaction, commit and rollback.  Now I migration to oracle and plan to use transactions.
> 
> 
> The problem is I find that if I want to use  beginTransaction, I have to change all the
> 
>         doInsert(crit)  to  doInsert(crit, dbcon)
> 
> and so do the  doUpdate, doDelete functions.
> 
> It is quite a big work.  I wonder:
> 
> 1. is my understanding correct?  or I am wrong, no such change needed
> 
> 2. if so, Any suggestion to reduce the migration work?
> 
> 3. Or has the latest version have some improvement to avoid such kind of issues?
> 
> Regards&Thanks
> 
> fanyun

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org