oracleoracle-appsoracleapplications

cannot find symbol symbol : method getDBTransaction()


I was trying to call a Concurrent Program from OA Framework. And here is the code. But I am getting following error:

Error::

cannot find symbol symbol : method getDBTransaction() location: class _myclass OADBTransaction tx = (OADBTransaction)getDBTransaction();

Here is the method:

public int submitCPRequest(String headerId) {

try {

OADBTransaction tx = (OADBTransaction)getOADBTransaction();
java.sql.Connection pConncection = tx.getJdbcConnection();
ConcurrentRequest cr = new ConcurrentRequest(pConncection);

String applnName = "PO"; //Application that contains the concurrent program
String cpName = "XXMY Concurrent program name "; //Concurrent program name
String cpDesc = "Concurrent Program Description"; // concurrent Program description

// Pass the Arguments using vector
// Here i have added my parameter headerId to the vector and passed the vector to the concurrent program

Vector cpArgs = new Vector();
cpArgs.addElement(headerId);
// Calling the Concurrent Program

int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs);
tx.commit();

return requestId;

} catch (RequestSubmissionException e) {
OAException oe = new OAException(e.getMessage());
//oe.setApplicationModule(this);
throw oe;

}
}

Solution

  • Instead of

    OADBTransaction tx = (OADBTransaction)getOADBTransaction();
    java.sql.Connection pConncection = tx.getJdbcConnection(); 
    

    I have tried

    OracleConnection pConncection = null;
    pConncection = (OracleConnection)TransactionScope.getConnection();
    

    And Worked. It may help someone.