----- Original Message -----
From: Leon Messerschmidt <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 9:34 AM
Subject: Re: Peers: Inserts with Multiple Tables


> > instantiate
> > populate
> >
> > aCD.setLocation(aLocation);
> >
> > aLocation.save();
> > aCD.save();
> >
> > john mcnally
> >
>
> Just my 2c.  This example is probably good enough, but if you're using a
> transactional db and it is important to you, for whatever reason, can do
> this:
>
> DBConnection dbCon = BasePeer.beginTransaction()
> try
> {
>     aLocation.save(dbCon);
>     aCD.save(dbCon);
>     BasePeer.commitTransaction (dbCon);
> }
> catch (Exception e)
> {
>     Log.error (e);
>     BasePeer.rollbackTransaction (dbCon);
> }
>
> ~ Leon
>

This seems to me a safer way of doing things but is the DBConnection taken
from the connection pool or is it a new connection?

Saimon

>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to