Hi,
for the login procedure on the server side I have to execute a call against a plsql package in front of the execution of the actual sql statement.
For test purpose I created a simple DMI Class like the following:
public DSResponse validateUser(DSRequest dsRequest) throws Exception {
log.info("processing validateUser");
SQLDataSource ds = (SQLDataSource) dsRequest.getDataSource();
CallableStatement cs = ds.getConnection().prepareCall("call auth_package.login(?,?)");
cs.setString(2, "test");
cs.setString(1, "test123");
cs.execute();
return dsRequest.execute();
}
The problem seems to be the recreation of connections. The call to the auth package is bound to a database connection, but in “dsRequest.execute()” a different connection is used. Therefore the call to the auth package is without effect.
Is it possible to use the same database connection for the first call to the auth package and for the subsequent sql statement?
If it’s not possible, what would be your proposal?
Christian
for the login procedure on the server side I have to execute a call against a plsql package in front of the execution of the actual sql statement.
For test purpose I created a simple DMI Class like the following:
public DSResponse validateUser(DSRequest dsRequest) throws Exception {
log.info("processing validateUser");
SQLDataSource ds = (SQLDataSource) dsRequest.getDataSource();
CallableStatement cs = ds.getConnection().prepareCall("call auth_package.login(?,?)");
cs.setString(2, "test");
cs.setString(1, "test123");
cs.execute();
return dsRequest.execute();
}
The problem seems to be the recreation of connections. The call to the auth package is bound to a database connection, but in “dsRequest.execute()” a different connection is used. Therefore the call to the auth package is without effect.
Is it possible to use the same database connection for the first call to the auth package and for the subsequent sql statement?
If it’s not possible, what would be your proposal?
Christian
Comment