0% found this document useful (0 votes)
54 views2 pages

Dynamic Datasource

The document provides instructions to make changes to the Dynamic Datasource code in JDeveloper 12c for a Jconnect taskflow. The changes include: 1. Replace uses of sessionFlowScope with pageFlowScope. 2. Update the coding to retrieve the datasource name from pageFlowScope instead of sessionFlowScope. 3. Change the taskflow behavior to always begin a new transaction and use isolation for shared data control.

Uploaded by

AKANT PATHAK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views2 pages

Dynamic Datasource

The document provides instructions to make changes to the Dynamic Datasource code in JDeveloper 12c for a Jconnect taskflow. The changes include: 1. Replace uses of sessionFlowScope with pageFlowScope. 2. Update the coding to retrieve the datasource name from pageFlowScope instead of sessionFlowScope. 3. Change the taskflow behavior to always begin a new transaction and use isolation for shared data control.

Uploaded by

AKANT PATHAK
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Please do some changes in Dynamic Datasource code in JDeveloper 12c for Jconnect taskflow

1. Change pageFlowScope in place of sessionFlowScope.

2. Then change coding as required for dynamic datasource

public Object getInfo(String infoType, Object env) {


Object dsName ;
try{
// dsName="jdbc/jagranOth";
if (EnvInfoProvider.INFO_TYPE_JDBC_PROPERTIES.equals(infoType)) {
Map session = ADFContext.getCurrent().getSessionScope();
// String datasource =(String)session.get("datasourceNm");
Map pageFlowScope = ADFContext.getCurrent().getPageFlowScope();
String datasource =(String)pageFlowScope.get("datasourceNm");
if (datasource!=null && !datasource.isEmpty())
dsName = datasource;

System.out.println("Data soruce name----->"+dsName);


//Object dsName = session.get("datasourceAdj");

if (dsName != null)
{
if (((Hashtable)env).containsKey(Configuration.JDBC_DS_NAME)) {
((Hashtable)env).put(Configuration.JDBC_DS_NAME,
(String)dsName);
}
}

}
}catch(java.lang.RuntimeException ex) {

}
return null;
}

3. Then change your taskflow behavior just changed in transaction

Always Begin New Transaction and shared data control use Isolation

You might also like