java component - ora-01013 error when calling ws.createResultSetSQL
kleeJan 25 2012 — edited Apr 4 2012Running Content Server 11.1.1.5 on WLS 10.3.5 in 64bit Linux environment. Same component/code runs great in dev environment, but consistently get this error in production. In production, query runs against view in same schema as system database. I can run the same query in either SQL Developer or SQLPlus and the results return nearly immediate - about 1 second.
The query in the Java component times-out nearly every single time, even when very little load on the system (late at night).
getMessage() returns "!csDbUnableToCreateResultSet
I have already set the default query timeout in config.cfg to 120 seconds.
Any suggestions? Really perplexed on this one!
Thank you, Ken
Here is an example of the Java code used in the call.
{code}package com.example;
import intradoc.common.ExecutionContext;
import intradoc.common.ServiceException;
import intradoc.common.SystemUtils;
import intradoc.data.DataBinder;
import intradoc.data.DataException;
import intradoc.data.DataResultSet;
import intradoc.data.ResultSet;
import intradoc.data.Workspace;
import intradoc.provider.Provider;
import intradoc.provider.Providers;
import intradoc.shared.FilterImplementor;
import intradoc.util.IdcMessage;
public class Test implements FilterImplementor {
public int doFilter(Workspace ws, DataBinder binder, ExecutionContext cxt) throws DataException, ServiceException {
String value = "-1";
String xEMP_NUM ="";
String SQL = "";
String ResultSetName = "XEMPNUMCOUNT";
int rowcount = 0;
DataResultSet result = null;
DataException error = null;
ResultSet temp = null;
Workspace wsTemp = null;
SystemUtils.trace("filterdebug", "Starting doFilter for Test");
xEMP_NUM = binder.getLocal("xEMP_NUM");
xEMP_NUM = (xEMP_NUM == null) ? null : xEMP_NUM.trim();
SystemUtils.trace("filterdebug", "xEMP_NUM=" + xEMP_NUM);
if (xEMP_NUM != null && !xEMP_NUM.equalsIgnoreCase("0") && xEMP_NUM.length() > 0) {
SQL = "select emp_num, emp_lname, emp_mname, emp_fname from emps where emp_num = " + xEMP_NUM.trim();
SystemUtils.trace("filterdebug", "SQL=" + SQL);
if (ws == null) {
SystemUtils.trace("filterdebug", "ws is null, getting ws from call to getSystemWorkspace()");
ws = getSystemWorkspace();
}
SystemUtils.trace("filterdebug", "try-catch block to get ResultSet from SQL");
try {
SystemUtils.trace("filterdebug", "start: temp = ws.createResultSetSQL(SQL)");
temp = ws.createResultSetSQL(SQL);
SystemUtils.trace("filterdebug", "end: temp = ws.createResultSetSQL(SQL)");
result = new DataResultSet();
result.copy(temp);
rowcount = result.getNumRows();
SystemUtils.trace("filterdebug","rowCount=" + rowcount);
} catch (DataException de) {
error = de;
SystemUtils.trace("filterdebug", "de.getMessage()=" + de.getMessage());
} finally {
// ws.releaseConnection();
}
if (rowcount > 0){
try {
int fieldCnt = result.getNumFields();
SystemUtils.trace("filterdebug", "fieldCnt=" + fieldCnt);
result.first();
xEMP_NUM = result.getStringValue(0);
binder.putLocal("xEMP_NUM",xEMP_NUM);
String xEMP_LNAME = result.getStringValue(1);
binder.putLocal("xEMP_LNAME",xEMP_LNAME);
String xEMP_MNAME = result.getStringValue(2);
binder.putLocal("xEMP_MNAME",xEMP_MNAME);
String xEMP_FNAME = result.getStringValue(3);
binder.putLocal("xEMP_FNAME",xEMP_FNAME);
} catch (NumberFormatException nfe) {
SystemUtils.trace("filterdebug", "nfe.getMessage()=" + nfe.getMessage());
}
} else {
SystemUtils.trace("filterdebug", "Throw error since xEMP_NUM is not in the ems table");
throw new ServiceException("Invalid Employee Number provided!");
}
if (error != null) {
SystemUtils.trace("filterdebug", "Throw error since error condition exists.");
throw error;
}
}
SystemUtils.trace("filterdebug", "Ending doFilter for Temp");
return CONTINUE;
}
public Workspace getSystemWorkspace() {
Workspace workspace = null;
Provider wsProvider = Providers.getProvider("SystemDatabase");
if (wsProvider != null) {
workspace = (Workspace)wsProvider.getProvider();
}
return workspace;
}
}
{code}