一个关于BMP调用的问题!
我仅仅在客户端程序调用一个create()方法向数据库插入一个数据,程序执行bean实现类中的ejbCreate()方法实现了数据插入,没有问题!但是,BMP自动调用ejbStore()方法,这时候会产生一个异常:Can't start a cloned connection while in manual transaction mode.跟踪进程序发现程序在ejbStore()中的conn.createcreateStatement()这句话跳出!
附上程序代码:
ejbCreate()
{
conn = getConnection();
pstmt = conn.prepareStatement("insert into test values(?,?)");
pstmt.setString(1, tt);
pstmt.setString(2, dd);
pstmt.executeUpdate();
}
ejbStore()
{
conn = getConnection();
pstmt = conn.createStatement();
pstmt.executeUpdate("update test set dd = 2");
}
我已经在程序中跟踪发现在ejbStore()中conn是能用的,实在搞不明白为什么!!!!!!!