JBO-26041 during "post-insert"
lucborsJul 24 2006 — edited Jul 26 2006Hi All,
I'm trying to implement an OracleForms post-insert trigger. I know that I have to overwrite the doDML, and execute my code after calling super.doDML.
The record gets inserted and committed. The code after the call to super is executed (i can see this in the session statements on the database) but keeps on throwing a JBO-26041. Why is this happening and how can i fix it ?
Here's my code:
/**Custom DML update/insert/delete logic here.
*/
protected void doDML(int operation, TransactionEvent e) {
super.doDML(operation, e);
// forms post-insert trigger
if (operation == DML_INSERT ) {
// Create the user.
if (getName() != null) {
if (getPassword() == getPassword()){
createUser(getName(), getPassword());
}
}
}
}
public void createUser(String UserName, String PassWord) {
String statement = "Begin Execute immediate"
+" 'create user "
+ UserName
+ " identified by "
+ PassWord
+"'; End;";
try{
CallableStatement cs =
getDBTransaction().createCallableStatement(statement, 1);
cs.execute();
}
catch (SQLException ex)
{
throw new JboException(ex);
}
}
And here is the error in my debugconsole:
06/07/24 11:09:49 [497] OracleSQLBuilder: ROLLBACK WORK TO SAVEPOINT 'BO_SP'
06/07/24 11:09:49 [498] DBTransactionImpl.postChanges failed...
06/07/24 11:09:49 [499] java.sql.SQLException: ORA-01086: SAVEPOINT 'BO_SP' never established
06/07/24 11:09:49 [500] DCBindingContainer.reportException :oracle.jbo.DMLException
06/07/24 11:09:49 [501] oracle.jbo.DMLException: JBO-26041: failed to post data to database during "Rollback to savepoint": SQL-statement "null".