Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i cannot use CMT when using rowset.jar

Status
Not open for further replies.

IPOz

Programmer
Jul 11, 2001
109
CN
Hi,friends
When i set the session bean's transaction attribute as "Container" ,it will throw "cannot commit transactional connection" as below:
...
public void updateCoffees(RowSet rs) throws SQLException
{
Connection con = null;
PreparedStatement stmt = null;

try {
CachedRowSet crs = (CachedRowSet)rs;
// moves the changes back to the database
con = getConnection();
crs.acceptChanges(con);
}catch(Exception e) {
EJBException re = new EJBException(e.getMessage());
throw re;
}
finally {
if (stmt != null) stmt.close();
if (con != null) con.close();
}
}
The errro is caused by acceptChanges() because there is no error when replaced with the following code:
...
stmt = con.prepareStatement("update coffees set PRICE=? where COF_NAME = ?");
stmt.setDouble(1, 100.00);
stmt.setString(2,"Columbian");
stmt.executeUpdate();
...
Cannot i use rowset in a CMT bean ?
IPO_z@cmmail.com
Garbage in,Garbage out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top