on 8/7/2000 12:28 PM, "Leon Messerschmidt" <[EMAIL PROTECTED]> wrote:
> DBConnection dbCon= BasePeer.beginTransaction (DBBroker.DEFAULT);
> Connection con = dbCon.getConnection();
> // Do queries with con
> BasePeer.commitTransaction (dbCon);
>
> Please *remember* that this only works with databases that supports
> transactions.
> If your database does not support transactions you should use:
>
> DBConnection dbCon= DBBroker.getInstance().getConnection(DBBroker.DEFAULT);
> Connection con = dbCon.getConnection();
> // Do queries with con
> DBBroker.getInstance().releaseConnection(dbCon);
Wait a second. If your database does not support transactions can we have
the beginTransaction() code either throw an exception (preferred I think) or
simply return a normal connection?
The reason I state this is imagine you have a general use application that
could run on multiple databases. If you are expecting transactions to work,
then obviously it won't run on all databases and should probably throw a
nice error if you attempt to use it on a database that doesn't support
transactions.
thanks,
-jon
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]