Intermittent Function sequence error in JDBC - ReferenceManager too eager?
Hello,
I'm experiencing intermittent "function sequence error" when executing the first next() on a resultset.
The java code:
protected String getNextSequenceId(Connection con) throws DAOException {
String nextVal = null;
PreparedStatement ps = null;
ResultSet rs = null;
try {
ps = getPreparedStatement(con, "SELECT sq_JobsID.NEXTVAL FROM DUAL");
ps.executeQuery();
rs = ps.getResultSet();
if(rs.next()) {
nextVal = rs.getString(1);
} catch(SQLException se) {
handleSQLException(se);
} finally {
closeResultSet(rs);
closeStatement(ps);
return nextVal;
Enabling timesten trace logging reveals that the ReferenceManager finalizes the resultset before I get a chance to read from it. Any idea what could be done to prevent this?
Would changing to code to do "rs=ps.executeQuery();" instead of "ps.executeQuery(); rs = ps.getResultSet();" fix the problem?
Thanks.
BTW, I'm using TimesTen 7.0.3. The problem was seen both on Windows XP and Solaris 10.
TimesTen Trace log:
HttpThreadPool-8*JdbcOdbc.SQLPrepare(184632064, SELECT sq_JobsID.NEXTVAL FROM DUAL)
HttpThreadPool-8*JdbcOdbc.SQLGetStmtOption(184632064, 3031)
HttpThreadPool-8*JdbcOdbc.SQLGetStmtOption(184632064) Returning value = 0
HttpThreadPool-8*JdbcOdbc.SQLNumParams(184632064)
HttpThreadPool-8*JdbcOdbc.SQLNumParams(184632064) Returning: numParams = 0
HttpThreadPool-8*Connection.registerStatement(com.timesten.jdbc.JdbcOdbcPreparedStatement@114c15d)
HttpThreadPool-8*PreparedStatement.executeQuery()
HttpThreadPool-8*PreparedStatement.execute()
HttpThreadPool-8*JdbcOdbc.SQLExecute(184632064)
HttpThreadPool-8*JdbcOdbc.SQLExecute(184632064): Returning needData=false
HttpThreadPool-8*JdbcOdbc.SQLNumResultCols(184632064)
HttpThreadPool-8*JdbcOdbc.SQLNumResultCols(hStmt=184632064): Returning numCols = 1
HttpThreadPool-8*Statement.getResultSet()
HttpThreadPool-8*JdbcOdbc.SQLNumResultCols(184632064)
HttpThreadPool-8*JdbcOdbc.SQLNumResultCols(hStmt=184632064): Returning numCols = 1
HttpThreadPool-8*JdbcOdbc.SQLAllocAndBindCols(184632064)
HttpThreadPool-8*Statement.getResultSet()
HttpThreadPool-8*ReferenceManager.handleReference(com.timesten.jdbc.BasicPhantomReference@1d43f63)
HttpThreadPool-8*JdbcOdbcResultSet.doPostFinalization(com.timesten.jdbc.JdbcOdbcResultSet@18dacb5)
HttpThreadPool-8*JdbcOdbcResultSet.close()
HttpThreadPool-8*JdbcOdbc.SQLFreeStmt(184632064, 0)
HttpThreadPool-8*JdbcOdbcResultSet.next()
HttpThreadPool-8*JdbcOdbc.SQLFetch(184632064)
HttpThreadPool-8*JdbcOdbc.standardError(-1, 0, 0, 184632064)
HttpThreadPool-8*JdbcOdbc.createSQLException(0, 0, 184632064, true, true)
HttpThreadPool-8*JdbcOdbc.createSQLException:Reason = [TimesTen][TimesTen 7.0.3.0.0 ODBC Driver]Function sequence error; SQLstate = S1010; VendorCode = 0
Hi,
Are you using Spring or Apache? If so, here is some information from one of my colleagues that may be relevant.
They should turn OFF the singleton for the DAO bean (each DAO bean should NOT use a singleton query variable).
<bean id="procDAO" class="vae.data.dao.ProcDAO" destroy-method="close" singleton="false">
<property name="procDAOPool"><ref bean="procDAOPool"/></property>
<property name="timeAlloted"><value>${db.query.TimeAlloted}</value></property>
<property name="timeAllotedConf"><value>${db.query.TimeAllotedConf}</value></property>
<property name="counter"><value>${db.query.Counter}</value></property>
<property name="msgLimitPicContent"><value>${msgLimitPicContent}</value></property>
<property name="msgLimitBinaryStandard"><value>${msgLimitBinaryStandard}</value></property>
<property name="msgLimitNormalSMS"><value>${msgLimitNormalSMS}</value></property>
<property name="txnCommit"><value>true</value></property>
</bean>
What happens is that, when the query variable (the PreparedStatement) is a singleton, which seems to be the default on Spring, at low load levels everything is OK. However as the # of transactions increase, you have a case where
1) connection #1 enters the DAO bean and executes
2) connection #2 enters the bean and executes
3) connection #1 does executeQuery and getResultSet
4) connection #2 does executeQuery -- this INVALIDATES the resultset obtained by connection #1
5) when connection #1 tries to do getString the error comes out since the resultset is invalid
Could you let me know if this is your issue or not.
Thanks,
Chris
Similar Messages
-
Hi Chris, we where using this Java code with TimesTen 5.1.34:
while (rs.next()) {
associatedMsbs.add(Integer.toString(rs.getInt(HGROUPID)));
// Prepare object to insert in database
SvcLog_VO svcLog = new SvcLog_VO();
svcLog.setLogId(svcLogDAO.getlogIdNextVal(conn));
svcLog.setService( CommonConstants.MobileSwitchboardSvcId );
svcLog.setOperType( CommonConstants.OPER_TYPE_UPDREL );
svcLog.setEntityType( CommonConstants.ENTITY_TYPE_MOBILESWITCHBOARD);
svcLog.setEntityId( rs.getInt(HGROUPID) );
svcLog.setRelEntityId( woUserId );
// Insert object in database
svcLogDAO.insertData(svcLog, conn);
This code no longer works in TimesTen 7.0.3. We receive the following error:
[TimesTen 7.0.3.0.0 ODBC Driver]Function sequence error.
We had to change the code this way:
while (rs.next()) {
// Prepare object to insert in database
SvcLog_VO svcLog = new SvcLog_VO();
svcLog.setLogId(svcLogDAO.getlogIdNextVal(conn));
svcLog.setService( CommonConstants.MobileSwitchboardSvcId );
svcLog.setOperType( CommonConstants.OPER_TYPE_UPDREL );
svcLog.setEntityType( CommonConstants.ENTITY_TYPE_MOBILESWITCHBOARD);
svcLog.setEntityId( rs.getInt(HGROUPID) );
svcLog.setRelEntityId( woUserId );
// Store object in ArrayList
svcLogs.add(svcLog);
// Insert the objects in the ArrayList in database
for (int i = 0; i < svcLogs.size(); i++) {
SvcLog_VO svcLog = (SvcLog_VO)svcLogs.get(i);
svcLogDAO.insertData(svcLog, conn);
Once we split the code in two, first iterating the ResultSet and then inserting the objects, it works properly again. Is there any known issue in TimesTen about this?
Thanks in advance,Hi, Chris:
The code where this occurs is the following:
public void insertParameters(String xxx1, String xxx2, String xxx3,
int xxx4, Connection conn) throws TTException, SQLException {
PreparedStatement ps = null;
String query = null;
try {
query = queryInsert;
ps = conn.prepareStatement(query);
ps.setInt(1, xxx1);
ps.setString(2, xxx2);
ps.setString(3, xxx3);
ps.setString(4, xxx4);
// If debug is activated, the query is printed
if (log.isDebugEnabled()) {
ReadableQuery rq = new ReadableQuery();
rq.addParam(new Integer(xxx1));
rq.addParam(new String(xxx2));
rq.addParam(new String(xxx3));
rq.addParam(new String(xxx4));
log.debug(" Query to execute .. [" + rq.get(query) + "]");
ps.executeUpdate();
// Exception handling
catch (Exception ex) {
log.error(ex);
throw new TTException(ex);
} // Resources are closed
finally {
try {
if (ps != null) {
ps.close();
} catch (SQLException e) {
log.error("Error closing JDBC resources");
throw e;
This method accesses to DDBB and inserts data in a table with the following structure
Command> desc wo.bs_tb_bsvc_param_values;
Table XXXXXXX:
Columns:
*aaa TT_INTEGER NOT NULL
*bbb TT_CHAR (35) NOT NULL
ccc TT_CHAR (10) NOT NULL
ddd TT_CHAR (256) NOT NULL
1 table found.
(primary key columns are indicated with *)
Command>
Thanks. -
[ODBC Driver Manager] Function sequence error
Hi all,
i´m trying to built an webservice and if i try to run my code i get following
error: [ODBC Driver Manager] Function sequence error .CAn someone tell me what
this means?
Here comes my code:
static String Daten(int Nummer)
java.sql.Connection conn = null;
java.sql.Statement stmt = null;
try
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,
"t3://localhost:7001");
// Get a context for the JNDI look up
ctx = new InitialContext(ht);
javax.sql.DataSource ds
= (javax.sql.DataSource) ctx.lookup ("webservice-data-source");
conn = ds.getConnection();
System.out.println("Making connection...\n");
// execute some SQL statements to demonstrate the connection.
stmt = conn.createStatement();
System.out.println("Vor ResultSet");
ResultSet result = stmt.getResultSet(); //Bringt Fehler
final Vector erstespalte = new Vector();
final Vector zweitespalte = new Vector();
final Vector drittespalte = new Vector();
final Vector Zeilen;
final Vector end = new Vector();
try {//2.Block
stmt.executeQuery("Select * from Person where Kundennummer=5");
while(result.next())
erstespalte.add(result.getObject(1));
zweitespalte.add(result.getObject(2));
drittespalte.add(result.getObject(3));
Zeilen = new Vector();
for(Enumeration a = erstespalte.elements() ; a.hasMoreElements()
for(Enumeration b = zweitespalte.elements() ;b .hasMoreElements()
for(Enumeration c = drittespalte.elements() ; c.hasMoreElements()
Zeilen.add(a.nextElement());
Zeilen.add(b.nextElement());
Zeilen.add(c.nextElement());
end.add(Zeilen);
}System.out.println(end);
result.close();
}//2.try-Block
catch (SQLException e) {
System.out.println(e);
}//1.try-Block schliessen
catch (Exception e) {
System.out.println("Exception was thrown: " + e.getMessage());
finally {
try {
if (stmt != null)
stmt.close();
if (conn != null)
conn.close();
catch (SQLException sqle) {
System.out.println("SQLException during close(): " + sqle.getMessage());
}//finally-Block schliessen
return ("HAllo");
}//Methode abschliessen
Thank you very much for helping !!!Please post this in the JDBC newsgroup: weblogic.developer.interest.jdbc
Also, please include your full error message.
-- Rob
Hakan wrote:
Hi all,
i´m trying to built an webservice and if i try to run my code i get following
error: [ODBC Driver Manager] Function sequence error .CAn someone tell me what
this means?
Here comes my code:
static String Daten(int Nummer)
java.sql.Connection conn = null;
java.sql.Statement stmt = null;
try
Context ctx = null;
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,
"t3://localhost:7001");
// Get a context for the JNDI look up
ctx = new InitialContext(ht);
javax.sql.DataSource ds
= (javax.sql.DataSource) ctx.lookup ("webservice-data-source");
conn = ds.getConnection();
System.out.println("Making connection...\n");
// execute some SQL statements to demonstrate the connection.
stmt = conn.createStatement();
System.out.println("Vor ResultSet");
ResultSet result = stmt.getResultSet(); //Bringt Fehler
final Vector erstespalte = new Vector();
final Vector zweitespalte = new Vector();
final Vector drittespalte = new Vector();
final Vector Zeilen;
final Vector end = new Vector();
try {//2.Block
stmt.executeQuery("Select * from Person where Kundennummer=5");
while(result.next())
erstespalte.add(result.getObject(1));
zweitespalte.add(result.getObject(2));
drittespalte.add(result.getObject(3));
Zeilen = new Vector();
for(Enumeration a = erstespalte.elements() ; a.hasMoreElements()
for(Enumeration b = zweitespalte.elements() ;b .hasMoreElements()
for(Enumeration c = drittespalte.elements() ; c.hasMoreElements()
Zeilen.add(a.nextElement());
Zeilen.add(b.nextElement());
Zeilen.add(c.nextElement());
end.add(Zeilen);
}System.out.println(end);
result.close();
}//2.try-Block
catch (SQLException e) {
System.out.println(e);
}//1.try-Block schliessen
catch (Exception e) {
System.out.println("Exception was thrown: " + e.getMessage());
finally {
try {
if (stmt != null)
stmt.close();
if (conn != null)
conn.close();
catch (SQLException sqle) {
System.out.println("SQLException during close(): " + sqle.getMessage());
}//finally-Block schliessen
return ("HAllo");
}//Methode abschliessen
Thank you very much for helping !!! -
Function sequence error / Recursive functions error
Hi! I've a little problem over here. I have an application (servlet) that makes recursive functions with DB access. This function contains a resultset that calls the same function again until no more data is found. The problem, is that I'm using JDBC-ODBC bridge (because this must work in SQL Server, Informix, Sybase, Access and Oracle), so I need to make commit of the connection in every resultset. If I make the commit inside the resultset, I got a "Function Sequence error" exception. Of course, I can't close every statement inside the resultset (or at least I don't know how). My code looks like this:
public void myfunction(String odbc,String data1,String data2) throws SQLException,Exception{
//this class, myclassDB, just return a established connection with the DB
Connection connection = myclassDB.connect(odbc);
Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("query");
while(rs.next()){
//do something with the information
//make recursive
connection.commit();
myfunction(odbc,data1,data2);
statement.close();
connection.close();
}Hope you can help me!
Feel free to email me at [email protected]
Regards!I am not really sure what the question is but...
Presuming that there isn't something wrong with your design (which recursive calls suggest) then you need to extract all of the data, close the resultset/statement then do the recursive calls. If you do processing first then you can still commit on the connection. -
Function Sequence Error -- After upgrading to Crystal Reports 2008
Since we intergrated Crystal 2008 in our application, We are having the ODBC DRIVER ERROR "S1010, Function Sequence Error"
The following steps reproduces the error.
I open any crystal report(using my application) and close it.
And then I try to close another dialog in my application.
The destructor of that dialog has the DELETE FROM TMPRPT WHERE etc... But actually the TMPRPT table is empty.
But This Scenario in general, does not produce any error. Only after I open and close Crystal report, and when the TMPRPT table doesn't have any records, executing the above DELETE sql throws CDBException, Funciton Sequence Error.
Is it because of the upgrade/mismatch of dlls? Can any one help how to work around this?
Thanks.Hi Don,
I would like to thank you for your helpful advice. your tips for odbc tracing really works.
Just to simplify things, I have created a simple mfc dialog based application that opens a connection using CDatabase in the initdialog and closes the connection in the destructor(because that is how we do in our main large application). On the dialog i put a "Print" button and when i click it, I open a crystalreportform and fill the connectioninfo structure and then call SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument). on the Form_closed function, I close database connections and close the report document.
When I come back to mfc application I execute a Delete from table where 1 =0, basically any delete/update that return empty recordset and it throws function sequence error.
BOOL CCrystalDemoDlgDlg::OnInitDialog()
CDialog::OnInitDialog();
ConnectDatabase() ;
return TRUE; // return TRUE unless you set the focus to a control
BOOL CCrystalDemoDlgDlg::ConnectDatabase()
if ( m_Database.IsOpen() )
m_Database.Close();
// Process database open request.
CString szConnection("DSN=CRYSTALTEST32;UID=DBA;PWD=picture");
!m_Database.OpenEx( szConnection, CDatabase::noOdbcDialog ) )
return TRUE;
BOOL CCrystalDemoDlgDlg::bExecuteSQL( CString SqlString )
if(m_Database.IsOpen())
m_Database.ExecuteSQL( (LPCTSTR)SqlString );
return TRUE;
void CCrystalDemoDlgDlg::OnBnClickedBtnPrint()
TRY
bExecuteSQL(_T("DELETE FROM TMPRPT WHERE 1=0"));
CrystalReportsForm ^ CRForm = gcnew CrystalReportsForm(gcnew System::String("ActvSumm1.rpt"));
CRForm->ShowDialog();
//CRForm->RunCrystalReports();
delete CRForm;
CRForm = nullptr;
bExecuteSQL(_T("DELETE FROM TMPRPT WHERE 1=0"));
CATCH(CDBException, e)
AfxMessageBox( e->m_strError );
return ;
END_CATCH
the following is the code in crystalreports library
namespace CR2008Library
public partial class CrystalReportsForm : Form
private ReportDocument _reportDocument;
private string _reportFile = "C:\\Nomadic\\Report\\";
public CrystalReportsForm(string reportFile)
InitializeComponent();
_reportDocument = CreateReportDocument(reportFile);
private ReportDocument CreateReportDocument(string reportFile)
ReportDocument newDocument = new ReportDocument();
_reportFile += reportFile;
newDocument.Load(_reportFile);
return newDocument;
public void ConfigureCrystalReports()
ConnectionInfo connectionInfo = new ConnectionInfo();
connectionInfo.DatabaseName = "CRYSTALTEST";
connectionInfo.UserID = "DBA";
connectionInfo.Password = "picture";
connectionInfo.ServerName = "CRYSTALTEST32";
SetDBLogonForReport(connectionInfo, _reportDocument);
crystalReportViewer.ReportSource = _reportDocument;
private void SetDBLogonForReport(ConnectionInfo connectionInfo, ReportDocument reportDocument)
Tables tables = reportDocument.Database.Tables;
foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)
TableLogOnInfo tableLogonInfo = table.LogOnInfo;
tableLogonInfo.ConnectionInfo = connectionInfo;
table.ApplyLogOnInfo(tableLogonInfo);
public void CrystalReportForm_Load(object sender, EventArgs e)
ConfigureCrystalReports();
private void CrystalReportsForm_FormClosed(object sender, FormClosedEventArgs e)
DisposeCR();
private void DisposeCR()
// Clean up by closing and disposing of the ReportDocument object
if (_reportDocument != null)
if (_reportDocument.Database.Tables.Count > 0)
Tables tables = _reportDocument.Database.Tables;
foreach (Table table in tables)
table.Dispose();
_reportDocument.Database.Dispose();
_reportDocument.Close();
_reportDocument.Dispose();
_reportDocument = null;
I have the log file which doesn't show any error in crystalreports library. I am giving some of the log file for your reference to see what's happening while exiting from crystal and executing the problem sql
CrystalDemoDlg 16c8-e8c EXIT SQLFetch with return code 0 (SQL_SUCCESS)
HSTMT 00F41CC0
CrystalDemoDlg 16c8-e8c ENTER SQLFetch
HSTMT 00F41CC0
CrystalDemoDlg 16c8-e8c EXIT SQLFetch with return code 100 (SQL_NO_DATA_FOUND)
HSTMT 00F41CC0
CrystalDemoDlg 16c8-e8c ENTER SQLCloseCursor
SQLHSTMT 00F41CC0
CrystalDemoDlg 16c8-e8c EXIT SQLCloseCursor with return code 0 (SQL_SUCCESS)
SQLHSTMT 00F41CC0
CrystalDemoDlg 16c8-e8c ENTER SQLFreeHandle
SQLSMALLINT 3 <SQL_HANDLE_STMT>
SQLHANDLE 00F41CC0
CrystalDemoDlg 16c8-e8c EXIT SQLFreeHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 3 <SQL_HANDLE_STMT>
SQLHANDLE 00F41CC0
CrystalDemoDlg 16c8-e8c ENTER SQLDisconnect
HDBC 00F427A0
CrystalDemoDlg 16c8-e8c EXIT SQLDisconnect with return code 0 (SQL_SUCCESS)
HDBC 00F427A0
CrystalDemoDlg 16c8-e8c ENTER SQLFreeHandle
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 00F427A0
CrystalDemoDlg 16c8-e8c EXIT SQLFreeHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 00F427A0
CrystalDemoDlg 16c8-e8c ENTER SQLFreeHandle
SQLSMALLINT 1 <SQL_HANDLE_ENV>
SQLHANDLE 00F42718
CrystalDemoDlg 16c8-e8c EXIT SQLFreeHandle with return code 0 (SQL_SUCCESS)
SQLSMALLINT 1 <SQL_HANDLE_ENV>
SQLHANDLE 00F42718
CrystalDemoDlg 16c8-a34 ENTER SQLAllocStmt
HDBC 00F419A0
HSTMT * 0012E2C4
CrystalDemoDlg 16c8-a34 EXIT SQLAllocStmt with return code 0 (SQL_SUCCESS)
HDBC 00F419A0
HSTMT * 0x0012E2C4 ( 0x00f41cc0)
CrystalDemoDlg 16c8-a34 ENTER SQLSetStmtOption
HSTMT 00F41CC0
UWORD 0 <SQL_QUERY_TIMEOUT>
SQLPOINTER 0x0000000F
CrystalDemoDlg 16c8-a34 EXIT SQLSetStmtOption with return code 0 (SQL_SUCCESS)
HSTMT 00F41CC0
UWORD 0 <SQL_QUERY_TIMEOUT>
SQLPOINTER 0x0000000F (BADMEM)
CrystalDemoDlg 16c8-a34 ENTER SQLExecDirectW
HSTMT 00F41CC0
WCHAR * 0x03A30458 [ -3] "DELETE FROM TMPRPT WHERE 1=0\ 0"
SDWORD -3
CrystalDemoDlg 16c8-a34 EXIT SQLExecDirectW with return code 100 (SQL_NO_DATA_FOUND)
HSTMT 00F41CC0
WCHAR * 0x03A30458 [ -3] "DELETE FROM TMPRPT WHERE 1=0\ 0"
SDWORD -3
CrystalDemoDlg 16c8-a34 ENTER SQLNumResultCols
HSTMT 00F41CC0
SWORD * 0x0012E2B8
CrystalDemoDlg 16c8-a34 EXIT SQLNumResultCols with return code -1 (SQL_ERROR)
HSTMT 00F41CC0
SWORD * 0x0012E2B8
DIAG [S1010] [Microsoft][ODBC Driver Manager] Function sequence error (0)
CrystalDemoDlg 16c8-a34 ENTER SQLErrorW
HENV 00F418D8
HDBC 00F419A0
HSTMT 00F41CC0
WCHAR * 0x0012DE00 (NYI)
SDWORD * 0x0012E224
WCHAR * 0x0012DE20
SWORD 511
SWORD * 0x0012DE14
CrystalDemoDlg 16c8-a34 EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 00F418D8
HDBC 00F419A0
HSTMT 00F41CC0
WCHAR * 0x0012DE00 (NYI)
SDWORD * 0x0012E224 (0)
WCHAR * 0x0012DE20 [ 56] "[Microsoft][ODBC Driver Manager] Function sequence error"
SWORD 511
SWORD * 0x0012DE14 (56)
CrystalDemoDlg 16c8-a34 ENTER SQLErrorW
HENV 00F418D8
HDBC 00F419A0
HSTMT 00F41CC0
WCHAR * 0x0012DE00 (NYI)
SDWORD * 0x0012E224
WCHAR * 0x0012DE20
SWORD 511
SWORD * 0x0012DE14
I know that my post is too long, but i would like to give enough information for you to see what's happening. I use visual studio 2008 with crystal library 2008.
Thanks,
Lavanya. -
CLI0125E Function sequence error
Hi,
I'm using Websphere 3.5.2 and in consequence Java 1.2.2.
I already read bug database link: http://developer.java.sun.com/developer/bugParade/bugs/4243452.html
In our code we commonly execute database queries using a connection, a prepared statement and a result set. Each component has its own methods for accessing database.
We use servlets acessing a specific table in database (DB2 v.6) and a fa�ade method to access another table.
Ex: A servlet to add orders to the database in table TBL_ORDERS. To populate the combo with customers we instantiate the Curstomers EJB (that acesses the TBL_CUSTOMERS), and populate an array with the resultset of the Curstomers EJB.
The second call to ResultSet.next() gives us a "CLI0125E Function sequence error".
The following is our code flow:
public void LoadFromDatabase(Connection inputCon)
throws Exception
aVector = new Vector();
PreparedStatement tmpStmt = null;
ResultSet tmpRS = null;
String tmpSQLQuery = "SELECT * " +
"FROM TBL_ORDERS" +
"WHERE order_number = ?";
tmpStmt = inputCon.prepareStatement(tmpSQLQuery);
tmpStmt.setString(1, "0001");
tmpRS = tmpStmt.executeQuery();
// call the other component
aVector = getList();
// The error occurs on the execution of tmpRS.next(), a "CLI0125E Function sequence error".
tmpRS.next()
tmpRS.close();
tmpStmt.close();
} // end of method to load object from database
//method getList()
public Vector geList() {
Vector resp = new Vector();
try {
InitialContext jndiContext = new InitialContext();
Object objref = jndiContext.lookup("app/Customers");
BasEmpGrpBicHome home =
(BasEmpGrpBicHome) javax.rmi.PortableRemoteObject.narrow(objref,
BasEmpGrpBicHome.class);
BasEmpGrpBic oBasEmpGrpBic = home.create(oEnv);
Enumeration elements ;
elements = oBasEmpGrpBic.getCustomersListVector().elements();
for (int i=0;elements.hasMoreElements();i++)
BasEmpGrpBicView oAux = (BasEmpGrpBicView)elements.nextElement();
resp.add(oAux);
return resp ;
} catch (Exception e) {
e.printStackTrace();
return null ;
The method getCustomersListVector() has the same database interation stile.
Any idea what I can do to solve this problem?
Thanks a lot!I am running WEBSphere 3.5.3 connecting to DB2 (both on AIX) via JDBC. I am using connection pooling (connecting via the datasource factory). If I set the datasource properties on WEBSphere to 1 MinConnection and 1 MaxConnection everything works fine. If I bump up the Min & Max Connections I get the CLI0125E on occassion. Any ideas ?
Here is a snippet of the code:
private Connection ConnectToDB() throws ...
if ( ctx == null )
ctx = new InitialContext(parms);
ds = (DataSource)ctx.lookup( "jdbc/" + url );
return ds.getConnection(username, password);
public RecordSet GetData( String sql ) throws PruDataException
Statement statement=null;
ResultSet resultSet=null;
RecordSet aRecordSet=null;
Connection connection = null;
String resultString;
connection = ConnectToDB();
connection.setReadOnly(true);
statement = connection.createStatement();
resultSet = statement.executeQuery(sql);
aRecordSet = new RecordSet( resultSet );
resultSet.close();
statement.close();
connection.close();
return aRecordSet;
public RecordSet( ResultSet resultSet ) throws SQLException {
setColandRowData( resultSet );
private void setColandRowData( ResultSet rs ) throws SQLException
int totalCols;
ResultSetMetaData rsmd = rs.getMetaData();
totalCols = rsmd.getColumnCount();
colNames = new String[ totalCols ];
//add column names to string array
for (int i = 1; i <= totalCols; ++i)
colNames[i-1] = rsmd.getColumnName(i);
while ( rs.next() )
colData = new Object[ totalCols ];
for (int i = 1; i <= totalCols; ++i)
if (rsmd.getColumnTypeName( i ).equalsIgnoreCase("clob") )
Clob aClob = rs.getClob(i);
if ( aClob == null )
colData[i-1] = null;
else
colData[i-1] = aClob.getSubString(1,(int)aClob.length() );
else
colData[i-1] = rs.getObject(i);
rowData.addElement( colData );
rowCount++;
****** sample calling code *****
DataRequest aDataReq = new DataRequest();
RecordSet rs = aDataReq.GetData("SELECT ......");
if ( rs.RowCount() == 0 )
throw new WEBFactoryException( "No data found.."); -
Function Sequence Error exception
I get the following SQL exception when executing queries
'[Microsoft][ODBC Driver Manager] Function sequence error'
It doesn't always happen and it does not affect the results of the query.
Could any one offer any advice for this exception?
Thank you,
xer>>
in this case the database is MySQL so the
problem is either the MySQL ODBC driver or the
JdbcOdbcDriver and not the database.. becauseI
don't know about you but I have never seen a MySQL
database throw an error with a Mircrosoft errorcode
and description.
Yes and no.
The MySQL ODBC driver throws that error, so does have
something to do with MySQL. But as you say it also is
specific to ODBC.
thus we are able to eliminate the database as the
source of this particular problem in this case.
therefore in this case if we go directly from Javato
the database using a type 4 driver we areeliminating
the pieces of software that in this case in factare
causing the problem.Not necessarily. The error represents a problem.
Presumably it doesn't happen all the time, so
something in the users code causes it. The cause of
this might be due to a bug in the driver, or because
something is wrong in the users code and this is how
the driver ends up dealing with it. And using a
different driver won't eliminate the second case it
will just produce a different type of error.this is correct, however...
to solve a problem such as this in a logical or scientific manner we should start by elminating all variable sources of the error that we can.
using the second driver does eliminate as a possible source of the problem ODBC and the MySQL ODBC driver.
so if now another error does in fact surface as the MySQL JDBC driver equivalent to the problem then we can be fairly certain that the error is located in their code. which puts us much farther along in the debugging process. -
Function sequence error. in 64bit Windows 2008 Server.
Hi All,
Pardon me if the posting is not in the correct group.
I am migrating my application from 32bit(Windows 2003 Server) to 64bit (Windows 2008 Server R2).
I am getting the following while trying to execute a SQL command
Encountered ODBC error -1: S1010, 0, [Microsoft][ODBC Driver Manager] Function sequence error .
Basically internal function call is SQLExecute() function call. This works perfectly for Windows 2003 Server 32bit. I tried the command execute at the background from the command prompt and it is working.
I checked the squence of call.We have two consecutive SQLBindParameter function call and then we call SQLExecute. Is this sequence incorrect in case of 64bit? I also checked the return code given by SQLExecute which is 99.
Any help or suggestion would be very much appreciated.
Thanks,
-RHi Teun,
Yes i have build the addon & installer with x86. I am using Interop.SAPbouiCOM.dll , Interop.SAPbouiCOM.dll, System.dll , System.XML.dll.
I have not specified the relative path in code as such but iam loading my forms Load batch action i don't know if it ok in this scenario or not.
Building the Solution/Project is Successful without any warning.
While debugging it on my server it gives the same error "Object Reference Not Set to an Instance of an Object".
Debug Out put last errors are as follows:
A first chance exception of type 'System.IndexOutOfRangeException' occurred in mscorlib.dll
'TAMPA800.exe': Loaded 'C:\Windows\SysWOW64\sxs.dll'
First-chance exception at 0x76afe124 in TAMPA800.exe: Microsoft C++ exception: EEMessageException at memory location 0x0036ecec..
A first chance exception of type 'System.IO.FileNotFoundException' occurred in TAMPA800.exe
A first chance exception of type 'System.NullReferenceException' occurred in TAMPA800.exe
The thread 'Win32 Thread' (0x460) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xdb8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xfdc) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xfb4) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xdc8) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xe04) has exited with code 0 (0x0).
The program '[3872] TAMPA800.exe: Managed' has exited with code 0 (0x0).
The program '[3872] TAMPA800.exe: Native' has exited with code 0 (0x0).
Regards
John -
Running SQL Procedure with dg4msql errors: Function sequence error HY010
I am trying to execute a stored procedure on a SQL database and get the error Function sequence error HY010.
A simple query on a table returns teh expected result.
I have a single Win2008R2 server with MSSQL Express 2008 and Oracle 11gR2 (32bit not 64bit version of Oracle)
Below is the gateway init, listener and tnsnames files and the query I am trying to run:
-- initORIONWASP.ora --
HS_FDS_CONNECT_INFO=INGRDB//waspForGIS
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
HS_CALL_NAME=dbo.spTest;dbo.spQueryAsset;dbo.spQueryAssetDetails
HS_FDS_PROC_IS_FUNC=TRUE
HS_FDS_RESULTSET_SUPPORT=TRUE
-- Listener.ora -- (partial)
(SID_DESC =
(SID_NAME = ORIONWASP)
(ORACLE_HOME = C:\Oracle\product\11.2.0\dbhome_1)
(PROGRAM=dg4msql)
-- tnsnames.ora -- (partial)
ORIONWASP =
(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=INGRDB)(PORT=1521))
(CONNECT_DATA=(SID=ORIONWASP))
(HS=OK)
-- Simple Query --
Running select "Asset_ID" from asset@ORIONWASP; returns the correct result
Running select * from sys.procedures@ORIONWASP; returns a list of procedures including the procedure I want to run
-- This pl/sql block returns the error ******* identifier 'spTest@ORIONWASP' must be declared *******
declare
begin
"spTest"@ORIONWASP;
end;
-- This passthrough pl/sql block returns ******** [Oracle][ODBC SQL Server Driver]Function sequence error {HY010} ********
DECLARE
CRS BINARY_INTEGER;
RET BINARY_INTEGER;
v_COL1 VARCHAR2(50);
v_COL2 VARCHAR2(50);
BEGIN
CRS := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@ORIONWASP;
DBMS_HS_PASSTHROUGH.PARSE@ORIONWASP(CRS, 'exec spTest');
BEGIN
RET := 0;
WHILE (TRUE)
LOOP
ret := DBMS_HS_PASSTHROUGH.FETCH_ROW@ORIONWASP(CRS, FALSE);
DBMS_HS_PASSTHROUGH.GET_VALUE@ORIONWASP(CRS, 1, v_COL1);
DBMS_HS_PASSTHROUGH.GET_VALUE@ORIONWASP(CRS, 2, v_COL2);
DBMS_OUTPUT.PUT_Line('Col1:'||v_COL1||' Col2:'||v_COL2);
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
BEGIN
DBMS_OUTPUT.PUT_LINE('End of Fetch');
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@ORIONWASP(CRS);
END;
END;
END;
/The gateway configuration file contains:
HS_FDS_PROC_IS_FUNC=TRUE
HS_FDS_RESULTSET_SUPPORT=TRUE
This setting commonly causes problems and you need to set
HS_FDS_PROC_IS_FUNC=TRUE
HS_FDS_RESULTSET_SUPPORT=FALSE
for normal procedure calls and
HS_FDS_PROC_IS_FUNC=FALSE
HS_FDS_RESULTSET_SUPPORT=TRUE
when calling the procedure with ref cursors.
There's a note in My Oracle Support that gives you examples how to call remote SQl Server procedures
Note.197192.1 Different Methods How To Call MS SQL Server Procedures Using TG4MSQL - DG4MSQL
and another one for the Sybase gateway but this code is similar for the SQL Server:
Article-ID: Note 351400.1
Title: How to Call a Remote Sybase Procedure Using TG4SYBS -
SQL developer 3.1 throws Function sequence error
Hi,
I was able to connect to my remote timesten db and was able to compile and execute packages.
I tried modifying one of my packages to include dbms_lock.sleep in my code and then compiled the package.
while running the package i got some error related to locking.
The strange this is after this i am not able to connect to the timesten db using sql developer.
An error is thrown, "Could not connect to the database Function sequence error"
I tried restarting the timesten server and then also the same error exists.
How can i resolve this?
regards
LalHi,
This looks like a problem with the SQL*Developer Early Adopter release itself so it would be better if you opened a new thread in the SQL*Developer forum -
SQL Developer
That is monitored by the developers more than this thread so they are more likely to see it.
Regards,
Mikei -
How do I trace a function sequence error?
Hi,
can anyone tell me how I trace a function sequence error?
I have a piece of VB code (that has worked on many occassions, which runs to 9i.
I deleted the contents of my tables and then tried to run the same code again but got the following error message:
run time error '-2147467259 (80004005)':
[Oracle][ODBC]Function sequence error.
ODBC does not create a trace file for this error and I was wondering if there is any other way for me to find what is actually causing this problem.
thanks in advance,
Ed.You should be able to enable tracing through the ODBC Data Sources manager on the Control Panel.
Cheers, APC -
Function Sequence Errors with WebToGo
I'm trying to build an application using WebToGo, and I get Function Sequence errors whenever I try to access a ResultSet object on my JSP page. I'm trying to follow (and somewhat duplicate) the tutorial application included with the SDK.
Here is the faulty code on the JSP page:
<%@ page import="java.sql.*" %>
<jsp:useBean id="con" class="dbConnBeanLite" scope="session"/>
<pre>
ResultSet rs = null;
String testString = con.returnString();
out.println("<b>" + testString + "</b>");
String query = "SELECT * FROM TODO_ITEMS";
rs = con.executeQuery(request, query);
while (rs.next() == true) {
out.println("Todo: " + rs.getString("TO_DO") + "<br>");
</pre>
And here is the referenced executeQuery method:
<pre>
public ResultSet executeSQLQuery(HttpServletRequest request, String sqlQuery) {
ResultSet rs = null;
try {
Statement stmt = null;
if (conn == null) {
Principal user = request.getUserPrincipal();
conn = ((OraUserProfile) user).getConnection();
stmt = conn.createStatement();
stmt.execute(sqlQuery);
rs = stmt.getResultSet();
stmt.close();
conn.commit();
} catch (SQLException e) {
System.err.println("SQLException: " + e);
return rs;
</pre>
Here is the exception I get:
java.sql.SQLException: [ODBC S1010] function sequence error
at oracle.lite.poljdbc.LiteEmbResultSet.jniFetch(Native Method)
at oracle.lite.poljdbc.LiteEmbResultSet.fetch(Unknown Source)
at oracle.lite.poljdbc.POLJDBCResultSet.next(Unknown Source)
at beantest.beantest._jspService(_beantest.java:67)
at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
at oracle.jsp.JspServlet.internalService(JspServlet.java)
at oracle.jsp.JspServlet.service(JspServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at oracle.lite.web.JupServlet.service(JupServlet.java:190)
at oracle.lite.web.MimeServletHandler.handle(MimeServletHandler.java:85)
at oracle.lite.web.JupApplication.service(JupApplication.java:339)
at oracle.lite.web.JupHandler.handle(JupHandler.java:97)
at oracle.lite.web.HTTPServer.process(HTTPServer.java:302)
at oracle.lite.web.HTTPServer.handleRequest(HTTPServer.java:162)
at oracle.lite.web.JupServer.handle(JupServer.java:309)
at oracle.lite.web.SocketListener.process(SocketListener.java:157)
at oracle.lite.web.SocketListener$ReqHandler.run(SocketListener.java:208)Hi Darren,
This problem seems to occur when an administrator deletes the local trust relationship of the farm from the Security section of the Central Administration website
In order to resolve this problem, the local trust relationship has to be created. This can be done by running the following PowerShell commands
$rootCert = (Get-SPCertificateAuthority).RootCertificate
New-SPTrustedRootAuthority -Name "localNew" -Certificate $rootCert
After running the above commands, perform an IISReset on all servers in the farm.
More information:
http://support.microsoft.com/kb/2545744
Best Regards,
Wendy
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Wendy Li
TechNet Community Support -
i have a programm ... every time i try to add somthing to it ; wiil bring an error message telling me that there is an (sql function sequence error) ....
for example i have somthing like
if(i<beginYear){
principal[i] = amount/installment;//somthing like that
//other statments
here i tried to change it like
if(i<beginYear + 1)
and the error came .....
have you any idea..!!!actually iam using a microsoft access table but what is sstrange is that the error comes after the data base has been closed , so i didnt see any connection between the sql and what is going on..... i wander what usually ment by sql funftion sequence error...
-
What (the hell) is SQL Exception called Function sequence error?
...doing in a code like this:
ResultSet friends=...executeQuery...
while (friends.next())
log.append(friends.getString("sendergsm"));
somewhere in between that loop, or sometimes the loop runs out fine, and sometimes it throws SQLException called General Error. Not guite normal...Thank you for replying... that must be agains some of the policies of the sun, to make methods that may be called normally, but may cause an error.
Anyway, this is my first database application. The number of problems I've had in few days is unbelivable. I wonder does it load the drivers from disk or something everytime it reads one record from database. I mean when I did the above query, the table had about 10 entries (the program showed 5 to 10 before function sequense error) and displaying each record to TextArea took over second. (In paradox (The dosversion) this would have taken less than a second).
And paradox tables doesn't work at all because it raises exception: Table isn't expected format. If I set paradox 4.0 drivers and put paradox 4.0 tables, you would guess that the format would be expected. And you cannot create paradox tables with SQL. Now I need to use access databases. How can database containing 60 records be 500kb:s? When it will contain 50000 new records every day, i guess I'll be in problem. Each tranaction (say 5 simple queries) taking minutes... heelp meee!! -
SQLException [Microsoft][ODBC SQL Server Driver] Function sequence error
I get this message when trying to write to a column of type 'IMAGE' on SQL Server 2000 when the size of the file I am trying to write is 0.
PreparedStatement ps = con.prepareStatement( "UPDATE " + dbSchema + "File set filename = ?, filetype = ?, filedata=? WHERE FileId= ?" );
ps.setString(1, fileName);
ps.setString(2, fileType);
fis = new FileInputStream( fileDataInput );
ps.setBinaryStream( 3, fis, (int)fileDataInput.length() );
ps.setInt(4, fileID);
ps.executeUpdate();
ps.close();
fis.close();
The Exception is thrown on ps.executeUpdate(). This only occurs when I try to save a file with a size of 0 bytes. I know this situation occuring in production is unlikely but I want to code for it anyway.
Any suggestions?
Thanks
AlIt took me a while to see the obvious. I put a condition on the SQL statement. If the file size was 0 then I didnt include the binary data in the update.
Maybe you are looking for
-
I am getting probkem my itunes is showin error 3194 wat shld i do
i have os 4.3.5 on my iphone i am gettin problem in installin os 5 for iphone 5 itune is not able to rstore my phone i dint lose any data on my phone everythin is as it is only showin itune failed to restore your phone
-
Not enough memory to open file
I am unable to open a 1.7 mb file in photoshop 6. I had it opened about 3 weeks ago but made no changes. I downloaded a new copy of the file thinking my version was corrupted but no luck. I am running windows xp, 2.8 ghz celeron and just installed
-
"the installer failed to initialize" Photoshop CS5
Hello, I've downloaded CS 5 extended from adobe.com, i used adobe extractor to extract the file but when i tried to install it, the box above showed up. I tried to restart the computer but i still didn't work. What should I do?
-
HP d155xi "quality" and "duplex" features not available on OS X 10.4.8.
I have a networked HP d155xi that I print to from my G4 iMac running 10.2.8 (Jaguar) with no problem. Recently I purchased an Intel Core 2 duo iMac running 10.4.8 (Tiger) and downloaded the s/w driver for this printer from the HP website. Installatio
-
When I install Flash Player version 10.2.152.32, it shows up in the control panel, under Programs and Features but the only thing that shows up is the name and version of the product. On the right hand side, the size of the program in megabites is s