You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by pc leung <pi...@gmail.com> on 2005/12/07 03:54:53 UTC

how to better save a trans with DBCP?

I have classes which deal with tables individually.
In each class, it has the following lines to get connection pooling
and then commit a single table.

Context envCtx =3D (Context) ctx.lookup("java:comp/env");
DataSource ds =3D (DataSource) envCtx.lookup("jdbc/myERP");
conn =3D ds.getConnection();
stmt =3D conn.prepareStatement("UPDATE ???");

If a transaction consists of several tables,
how can I group them so that I can get a single connection from the pool,
and then commit it.

thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org