PreparedStatement.executeBatch() and BatchUpdateException

Hi,
I am using PreparedStatement's executeBatch() method to make batch operations,
for such a scenario is there a way to continue the operation 3 and 4 when the operation 2 fails?
operation 1 (will succeed alone)
operation 2 (will fail alone)
operation 3 (will succeed alone)
operation 4 (will succeed alone)

Hi, I've already looked the link you've sent.
Let me give more detail about the result of my scenario.
The first two successfull insert operations really updates the database which is Oracle.
But it seems the failed 3rd operation prevents the operation 4 to update database.
My code is something like that:
int[] updateCounts = null;
try {
PreparedStatement stmtInsert = conn.prepareStatement("insert sql");
for (int i=0; i <SOMEVALUE; i++)
     stmtInsert.setString(1, SOMEVALUE);
     stmtInsert.setString(2, SOMEVALUE);
     stmtInsert.addBatch();
int[] counts = stmtInsert.executeBatch();
} catch (BatchUpdateException e)
updateCounts = e.getUpdateCounts();
checkUpdateCounts(updateCounts);
finally {
conn.close();
public static void checkUpdateCounts(int[] updateCounts) {
for (int i = 0; i < updateCounts.length; i++) {
if (updateCounts[i] == Statement.SUCCESS_NO_INFO) {
// Successfully executed; number of affected rows not available
System.out.println("Statement.SUCCESS_NO_INFO");
} else if (updateCounts[i] == Statement.EXECUTE_FAILED) {
System.out.println("Statement.EXECUTE_FAILED");
The results are pretty confusing, as I said first two operations updates the db, but fourth is did not.
But system out says:
Statement.EXECUTE_FAILED
Statement.EXECUTE_FAILED
Statement.EXECUTE_FAILED
Statement.EXECUTE_FAILED
I would expect something like that:
Statement.SUCCESS_NO_INFO");
Statement.SUCCESS_NO_INFO");
Statement.EXECUTE_FAILED
Statement.EXECUTE_FAILED
or even better (assuming operation 4 updated the db)
Statement.SUCCESS_NO_INFO");
Statement.SUCCESS_NO_INFO");
Statement.EXECUTE_FAILED
Statement.SUCCESS_NO_INFO");
Since the size of the int array that the e.getUpdateCounts() is 4 which is also equal of the batch operations' size, I assume that the driver continues to process the commands in the batch after a BatchUpdateException is thrown.
I am totally confused, can anybody comment these results? Is there a way to succeed the fourth operation?

Similar Messages

  • PreparedStatement.executeBatch() Not Working

    Hello,
    I'm having a problem with the executeBatch() command. It seems that whenever I used it, my program just hangs up. What this program do is that it first read a text file and place it in an Array. Then it would also read the Database and place the contenent of the table in an array as well. Each Array has at least 100,000 records. If the record from the textfile and the database matches, it would update the table using a preparedStatement.addBatch() command. After the said loop, it is then that the int[] cnt = preparedStatement.executeBatch() command is called. and that is when the Hanging part begins. Can you help me.
    Thanks.

    Hello,
    Yes, i'm using a JDBC-ODBC bridge. The dirver is (sun.jdbc.odbc.jdbcodbcdriver). I tried examining the program patiently waited, and eventually it did not hang anymore. At first instance, I did gave the program some time and look if it really hangs, but after 15-30 mins, it work but the the second executeBatch() didn't work. There were no errors or exception that were caught.
    Thanks.
    Hi,
    What driver are you using? And are you using the JDBC
    - ODBC bridge? Please post the exact error message you
    are getting when you try to do executeBatch().
    Nish

  • PreparedStatement executeBatch

    Hi Guys!
    I'll be executing multiple sql statement and I'm using executeBatch of PreparedStatement. But I'm having some problem when I get errors during the execution (e.g. UNIQUE CONSTRAINT). The process stops on that point. What I want to happen is to continue the process even I encountered errors. Please help me! Thanks!

    Hi,
    Have you read the documentation?

  • PreparedStatement space and empty String

    Hi, I have this problem:
    PreparedStatement bookedQtyPS = null;
    String qry="SELECT * from djwsearch where djwitem=?;
    bookedQtyPS = conn.prepareStatement(qry);
    if(item.equals(""){ //item is an empty String
    bookedQtyPS.setString(1," "); // I set space instead of empty String
    }else{
    bookedQtyPS.setString(1,item);
    My problem is that I need to set space insteadOf empty String, but I think that I can not use PreparedStatement to do this. I have performance problems (my query is much more complicated than this one) so I choose PreparedStatement and not Statement.
    How can I do? Is this bug solved using PreparedStatement?
    Thanks.

    you can do it with the help of PreparedStatement.
    Here the type of field(djwitem) and setmethod is should be match..i mean if the type of ur field is String then you need to use the setSting method.
    you can do one thing specify one string variable.
    String space=" ";
    and now put this sapce variable at the second parameter of setString method.

  • SQL0100W BatchUpdateException in DB2

    All,
    I think there is some problem with DB2 8.1 JDBC driver. I get
    SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
    exception when I use preparedstatement.executeBatch() and I have only one statement in the batch [to delete a non existing row from a table]
    code snip....
    while(resultSet.next()){
    long id = resultSet.getLong("ID");
    stmt1 = connection.createStatement();
    stmt1.addBatch("DELETE FROM test WHERE ID ="+id);
    stmt1.executeBatch(); //executes successfully without any exception
    System.out.println("1Here");
    stmt = connection.prepareStatement("DELETE FROM test WHERE ID = ?");
    stmt.setLong(1,id);
    stmt.addBatch();
    stmt.executeBatch(); //throws exception SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a
    query is an empty table. SQLSTATE=02000
    System.out.println("2Here");
    Please let me know if this is a bug in the driver implementation or some silly mistake from my side.
    Thanks in advance,
    v_d_s

    Sir,
    Well the error is telling you what you already now... ie. the row doesn't exist. So it's not really a bug. I'm not sure I would hae classified it as an Exception rather than an Warning but the API only says
    BatchUpdateException (a subclass of SQLException) if one of the commands sent to the database fails to execute properly or attempts to return a result set.
    So I guess how fails to execute properly is open to interpretation.
    Sincerely,
    Slappy

  • PreparedStatement and executeBatch()

    Hi,
    I am trying to insert records into the database using the addBatch() and executeBatch() methods. I am using PreparedStatement. And I am trying to insert 52 records at a time.
    I have the records in an array, and I am looping through the array, setting the parameters for the prepared statement and doing addBatch(). And finally when I come out of the loop I call preparedStatement.executeBatch().
    int[] updateCounts = ps.executeBatch();
    Here it is throwing out the ArrayIndexOutOfBoundsException. Anybody has any idea why this is happening? This works fine with the Statement object, but it is with the PreparedStatement that I am having this problem. I am using JDK 1.3. My database is DB2 UDB 7.1 and my driver is IBM DB2 ODBC Driver.
    thanks in advance,
    Nish

    Hi,
    Thanks for the reply... Here is my code.
    public void insertNetFcst(Connection con, PreparedStatement ps, NetForecast[] arrNF){
    Connection conn = con;
    PreparedStatement psIns = ps;
    NetForecast[] arrNet = new NetForecast[52]; //Array of objects of type NetForecast
    arrNet = arrNF;
    int intLen = 0;
    intLen = arrNet.length;
    try{                    
    for (int ins = 0; ins < intLen; ins++){
    NetForecast nFct = new NetForecast();
    nFct = (NetForecast)arrNet[ins];
    psIns.setString(1, nFct.getCorpId());
    psIns.setString(2, nFct.getDivId());
    psIns.setString(3, nFct.getShipWhseId());
    psIns.setString(4, nFct.getRecvWhseId());
    psIns.setDouble(5, nFct.getUpcId());
    psIns.setInt(6, nFct.getYearId());
    psIns.setInt(7, nFct.getWeekNbr());
    psIns.setInt(8, nFct.getDemandQty());
    psIns.setString(9, nFct.getUomCode());
    psIns.setInt(10, nFct.getReqdYear());
    psIns.setInt(11, nFct.getReqdWeek());
    psIns.setString(12, nFct.getFcstTypeInd());
    psIns.setTimestamp(13, new Timestamp(System.currentTimeMillis()));
    psIns.addBatch();
    int[] updateCounts = psIns.executeBatch();
    //I am getting the exception at this line... where I call executeBatch()
    conn.commit();
    catch(BatchUpdateException b){
    System.err.println("SQLException: " + b.getMessage());
    System.err.println("SQLState: " + b.getSQLState());
    System.err.println("Message: " + b.getMessage());
    System.err.println("Vendor: " + b.getErrorCode());
    System.err.print("Update counts: ");
    int [] updateCounts = b.getUpdateCounts();
    for (int i = 0; i < updateCounts.length; i++) {
    System.err.print(updateCounts[i] + " ");
    b.printStackTrace();
    catch(SQLException insExp){
    System.out.println("Duplicate record exception..." + insExp);
    thanks,
    Nish

  • What is the different between statement and preparedstatement?

    hi,
    recently i have attended a telephonic interview. they asked me what is the different between statement and preparedstatement? and when u will use them? Hi! can any one say me the original difference??

    sorry dear,
    i am already shortlisted. and monday is my HR round.
    . Every 1 is not like u.
    So you have read the examples and explanations that you found when you googled, and you have read the javadoc and you still don't understand? And you are shortlisted? For what? I hope you won't do server programming.
    I will give you a few hints.
    Escaping of data
    Storing of dates
    Safer
    Faster

  • Closed Connection exceptions every day with WL813 SP3 and 10g

    Every day we get closed connection exceptions (which I think in turn leads to Heuristic Hazard exceptions), the first time we run the tests after restarting Weblogic and database.
    I tried various WL parameters so far but not with much luck. The parameters I tried include setting "Test Reserved Connections", "Test Created Connections", "Test Released Connections", "Connection Creation Retry Frequency", disabling "Allow Shrinking" etc.
    I tried weblogic support but so far not much progress. Any help is greatly appreciated. Following are the log traces.
    Server.log Fragment:
    ####<Mar 23, 2005 12:06:30 AM UTC> <Error> <JDBC> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <> <BEA-001112> <Test "select count(*) from dual" set up for pool "TruthPool" failed with exception: "java.sql.SQLException: Closed Connection".>
    ####<Mar 23, 2005 12:06:30 AM UTC> <Info> <JDBC> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <> <BEA-001128> <Connection for pool "TruthPool" closed.>
    ####<Mar 23, 2005 12:06:31 AM UTC> <Info> <JDBC> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <> <BEA-001067> <Connection for pool "TruthPool" refreshed.>
    ####<Mar 23, 2005 12:06:31 AM UTC> <Error> <JTA> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <BEA1-1B44D3A1A2E1DF26344B> <BEA-110412> <Name=[EJB com.opsware.list.PaginatedListBean.getList(int,int)],Xid=BEA1-1B44D3A1A2E1DF26344B(6341523),Status=Committed,HeuristicErrorCode=XA_HEURHAZ,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=2,seconds left=119,activeThread=Thread[ExecuteThread: '26' for queue: 'default',5,Thread Group for Queue: 'default'],XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=committed,assigned=twist),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@c806dc,re-Registered = false),SCInfo[twist_domain+twist]=(state=committed),properties=({weblogic.transaction.name=[EJB com.opsware.list.PaginatedListBean.getList(int,int)], weblogic.jdbc=t3://192.168.198.5:1026}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=twist+192.168.198.5:1026+twist_domain+t3+, XAResources={},NonXAResources={})],CoordinatorURL=twist+192.168.198.5:1026+twist_domain+t3+) completed heuristically: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Closed Connection)) >
    ####<Mar 23, 2005 12:06:31 AM UTC> <Error> <EJB> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB com.opsware.list.PaginatedListBean.getList(int,int)],Xid=BEA1-1B44D3A1A2E1DF26344B(6341523),Status=Committed,HeuristicErrorCode=XA_HEURHAZ,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=2,seconds left=119,XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=committed,assigned=twist),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@c806dc,re-Registered = false),SCInfo[twist_domain+twist]=(state=committed),properties=({weblogic.transaction.name=[EJB com.opsware.list.PaginatedListBean.getList(int,int)], weblogic.jdbc=t3://192.168.198.5:1026}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=twist+192.168.198.5:1026+twist_domain+t3+, XAResources={},NonXAResources={})],CoordinatorURL=twist+192.168.198.5:1026+twist_domain+t3+): javax.transaction.HeuristicMixedException: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Closed Connection))
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:294)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:244)
         at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:299)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:110)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    .>
    JDBC Log:
    JDBC log stream started at Tue Mar 22 22:44:30 UTC 2005
    DriverManager.initialize: jdbc.drivers = null
    JDBC DriverManager initialized
    registerDriver: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@29a046]
    DriverManager.getDriver("jdbc:oracle:oci:@")
    trying driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@29a046]
    getDriver returning driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@29a046]
    registerDriver: driver[className=weblogic.jdbc.jts.Driver,weblogic.jdbc.jts.Driver@1c68b20]
    registerDriver: driver[className=weblogic.jdbc.pool.Driver,weblogic.jdbc.pool.Driver@f0b51d]
    SQLException: SQLState(23000) vendor code(1)
    java.sql.SQLException: ORA-00001: unique constraint (TRUTH.TMP$ACCT_ID_PK) violated
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:630)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_describe(T2CPreparedStatement.java:851)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_rows(T2CPreparedStatement.java:1012)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8661)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:137)
         at com.opsware.utils.SQLHelper.setFilterIds(SQLHelper.java:90)
         at com.opsware.utils.SQLHelper.setFilterAcctIds(SQLHelper.java:45)
         at com.opsware.list.impl.device.DeviceBaseList.getQuery(DeviceBaseList.java:178)
         at com.opsware.list.impl.device.DeviceBaseList.getIds(DeviceBaseList.java:50)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getDeviceIds(DeviceServerGroupViewList.java:145)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getIds(DeviceServerGroupViewList.java:47)
         at com.opsware.list.PaginatedListBean.init(PaginatedListBean.java:77)
         at com.opsware.list.PaginatedListBean.getSize(PaginatedListBean.java:216)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getSize(PaginatedList_mywl9s_EOImpl.java:154)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(23000) vendor code(1)
    java.sql.BatchUpdateException: ORA-00001: unique constraint (TRUTH.TMP$ACCT_ID_PK) violated
         at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8726)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:137)
         at com.opsware.utils.SQLHelper.setFilterIds(SQLHelper.java:90)
         at com.opsware.utils.SQLHelper.setFilterAcctIds(SQLHelper.java:45)
         at com.opsware.list.impl.device.DeviceBaseList.getQuery(DeviceBaseList.java:178)
         at com.opsware.list.impl.device.DeviceBaseList.getIds(DeviceBaseList.java:50)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getDeviceIds(DeviceServerGroupViewList.java:145)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getIds(DeviceServerGroupViewList.java:47)
         at com.opsware.list.PaginatedListBean.init(PaginatedListBean.java:77)
         at com.opsware.list.PaginatedListBean.getSize(PaginatedListBean.java:216)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getSize(PaginatedList_mywl9s_EOImpl.java:154)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(23000) vendor code(1)
    java.sql.SQLException: ORA-00001: unique constraint (TRUTH.TMP$DATA_CENTER_ID_PK) violated
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:630)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_describe(T2CPreparedStatement.java:851)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_rows(T2CPreparedStatement.java:1012)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8661)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:137)
         at com.opsware.utils.SQLHelper.setFilterIds(SQLHelper.java:90)
         at com.opsware.utils.SQLHelper.setFilterDcIds(SQLHelper.java:36)
         at com.opsware.list.impl.device.DeviceBaseList.getQuery(DeviceBaseList.java:196)
         at com.opsware.list.impl.device.DeviceBaseList.getIds(DeviceBaseList.java:50)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getDeviceIds(DeviceServerGroupViewList.java:145)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getIds(DeviceServerGroupViewList.java:47)
         at com.opsware.list.PaginatedListBean.init(PaginatedListBean.java:77)
         at com.opsware.list.PaginatedListBean.getSize(PaginatedListBean.java:216)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getSize(PaginatedList_mywl9s_EOImpl.java:154)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(23000) vendor code(1)
    java.sql.BatchUpdateException: ORA-00001: unique constraint (TRUTH.TMP$DATA_CENTER_ID_PK) violated
         at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8726)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:137)
         at com.opsware.utils.SQLHelper.setFilterIds(SQLHelper.java:90)
         at com.opsware.utils.SQLHelper.setFilterDcIds(SQLHelper.java:36)
         at com.opsware.list.impl.device.DeviceBaseList.getQuery(DeviceBaseList.java:196)
         at com.opsware.list.impl.device.DeviceBaseList.getIds(DeviceBaseList.java:50)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getDeviceIds(DeviceServerGroupViewList.java:145)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getIds(DeviceServerGroupViewList.java:47)
         at com.opsware.list.PaginatedListBean.init(PaginatedListBean.java:77)
         at com.opsware.list.PaginatedListBean.getSize(PaginatedListBean.java:216)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getSize(PaginatedList_mywl9s_EOImpl.java:154)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(42000) vendor code(936)
    java.sql.SQLException: ORA-00936: missing expression
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:630)
         at oracle.jdbc.driver.T2CStatement.execute_for_describe(T2CStatement.java:841)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:894)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:984)
         at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1124)
         at weblogic.jdbc.wrapper.Statement.executeQuery(Statement.java:345)
         at com.opsware.impl.servergroup.ServerGroupSQL.refreshLocalCoreMemberships(ServerGroupSQL.java:897)
         at com.opsware.ejb.session.ServerGroupFacadeBean.refreshMembershipsInLocalCore(ServerGroupFacadeBean.java:497)
         at com.opsware._gen.sejb.ejb.session._ServerGroupFacadeBean._opsw__refreshMembershipsInLocalCore(_ServerGroupFacadeBean.java:10715)
         at com.opsware._gen.sejb.ejb.session.ServerGroupFacade_686jy5_EOImpl._opsw__refreshMembershipsInLocalCore(ServerGroupFacade_686jy5_EOImpl.java:8902)
         at com.opsware._gen.client.ejb.session._ServerGroupFacadeStub._opsw__refreshMembershipsInLocalCore(_ServerGroupFacadeStub.java:5096)
         at com.opsware._gen.client.ejb.session._ServerGroupFacadeStub.refreshMembershipsInLocalCore(_ServerGroupFacadeStub.java:5091)
         at com.opsware.impl.groupevent.Recalc.performFullRecalc(Recalc.java:204)
         at com.opsware.impl.groupevent.Recalc$1.run(Recalc.java:573)
         at java.lang.Thread.run(Thread.java:534)
    SQLException: SQLState(60000) vendor code(600)
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kpofdr-long], [], [], [], [], [], [], []
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:630)
         at oracle.jdbc.driver.T2CPreparedStatement.doDefineExecuteFetch(T2CPreparedStatement.java:1135)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_rows(T2CPreparedStatement.java:1010)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:913)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2885)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2926)
         at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:92)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.ejbFindByDvcRoleAndKey(DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.java:652)
         at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.scalarFinder(RDBMSPersistenceManager.java:294)
         at weblogic.ejb20.manager.BaseEntityManager.scalarFinder(BaseEntityManager.java:1662)
         at weblogic.ejb20.manager.BaseEntityManager.localScalarFinder(BaseEntityManager.java:1611)
         at weblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:462)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g_LocalHomeImpl.findByDvcRoleAndKey(DeviceRoleConfig_bbuo9g_LocalHomeImpl.java:132)
         at com.opsware.impl.device.DeviceUtil.getAttributeNL(DeviceUtil.java:224)
         at com.opsware.impl.device.DeviceUtil.getLockUser(DeviceUtil.java:308)
         at com.opsware.vo.DeviceBaseVO.<init>(DeviceBaseVO.java:42)
         at com.opsware.vo.DeviceSWVO.<init>(DeviceSWVO.java:21)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getList(DeviceServerGroupViewList.java:173)
         at com.opsware.list.PaginatedListBean.getSubList(PaginatedListBean.java:173)
         at com.opsware.list.PaginatedListBean.getList(PaginatedListBean.java:124)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:100)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:698)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:615)
         at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:1133)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:966)
         at weblogic.jdbc.wrapper.PreparedStatement.reCreateStatement(PreparedStatement.java:48)
         at weblogic.jdbc.wrapper.Statement.checkStatement(Statement.java:237)
         at weblogic.jdbc.wrapper.Statement.close(Statement.java:300)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.releaseStatement(RDBMSPersistenceManager.java:3419)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.releaseResources(RDBMSPersistenceManager.java:3300)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.ejbFindByDvcRoleAndKey(DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.java:703)
         at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.scalarFinder(RDBMSPersistenceManager.java:294)
         at weblogic.ejb20.manager.BaseEntityManager.scalarFinder(BaseEntityManager.java:1662)
         at weblogic.ejb20.manager.BaseEntityManager.localScalarFinder(BaseEntityManager.java:1611)
         at weblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:462)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g_LocalHomeImpl.findByDvcRoleAndKey(DeviceRoleConfig_bbuo9g_LocalHomeImpl.java:132)
         at com.opsware.impl.device.DeviceUtil.getAttributeNL(DeviceUtil.java:224)
         at com.opsware.impl.device.DeviceUtil.getLockUser(DeviceUtil.java:308)
         at com.opsware.vo.DeviceBaseVO.<init>(DeviceBaseVO.java:42)
         at com.opsware.vo.DeviceSWVO.<init>(DeviceSWVO.java:21)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getList(DeviceServerGroupViewList.java:173)
         at com.opsware.list.PaginatedListBean.getSubList(PaginatedListBean.java:173)
         at com.opsware.list.PaginatedListBean.getList(PaginatedListBean.java:124)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:100)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:698)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:615)
         at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:1133)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:966)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:905)
         at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:350)
         at weblogic.jdbc.wrapper.JTSConnection.prepareStatement(JTSConnection.java:479)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.ejbFindByDvcRoleAndKey(DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.java:632)
         at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.scalarFinder(RDBMSPersistenceManager.java:294)
         at weblogic.ejb20.manager.BaseEntityManager.scalarFinder(BaseEntityManager.java:1662)
         at weblogic.ejb20.manager.BaseEntityManager.localScalarFinder(BaseEntityManager.java:1611)
         at weblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:462)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g_LocalHomeImpl.findByDvcRoleAndKey(DeviceRoleConfig_bbuo9g_LocalHomeImpl.java:132)
         at com.opsware.impl.device.DeviceUtil.getAttributeNL(DeviceUtil.java:224)
         at com.opsware.impl.device.DeviceUtil.getLockComment(DeviceUtil.java:316)
         at com.opsware.vo.DeviceBaseVO.<init>(DeviceBaseVO.java:43)
         at com.opsware.vo.DeviceSWVO.<init>(DeviceSWVO.java:21)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getList(DeviceServerGroupViewList.java:173)
         at com.opsware.list.PaginatedListBean.getSubList(PaginatedListBean.java:173)
         at com.opsware.list.PaginatedListBean.getList(PaginatedListBean.java:124)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:100)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:698)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:615)
         at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:1133)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:966)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:905)
         at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:350)
         at weblogic.jdbc.wrapper.JTSConnection.prepareStatement(JTSConnection.java:479)
         at com.opsware.ejb.RoleClassWads_opugk0__WebLogic_CMP_RDBMS.ejbFindByRoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads__WL_(RoleClassWads_opugk0__WebLogic_CMP_RDBMS.java:1510)
         at sun.reflect.GeneratedMethodAccessor256.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.collectionFinder(RDBMSPersistenceManager.java:378)
         at weblogic.ejb20.manager.BaseEntityManager.wrapperSetFinder(BaseEntityManager.java:1888)
         at weblogic.ejb20.manager.BaseEntityManager.localWrapperSetFinder(BaseEntityManager.java:1859)
         at com.opsware.ejb.RoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads_Set.populateCache(RoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads_Set.java:111)
         at com.opsware.ejb.RoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads_Set.iterator(RoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads_Set.java:177)
         at com.opsware.vo.DeviceSWVO.<init>(DeviceSWVO.java:35)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getList(DeviceServerGroupViewList.java:173)
         at com.opsware.list.PaginatedListBean.getSubList(PaginatedListBean.java:173)
         at com.opsware.list.PaginatedListBean.getList(PaginatedListBean.java:124)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:100)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:964)
         at weblogic.jdbc.wrapper.JTSConnection.internalCommit(JTSConnection.java:404)
         at weblogic.jdbc.wrapper.JTSXAResourceImpl.commit(JTSXAResourceImpl.java:56)
         at weblogic.transaction.internal.XAServerResourceInfo.commit(XAServerResourceInfo.java:1251)
         at weblogic.transaction.internal.XAServerResourceInfo.commit(XAServerResourceInfo.java:482)
         at weblogic.transaction.internal.ServerSCInfo.startCommit(ServerSCInfo.java:421)
         at weblogic.transaction.internal.ServerTransactionImpl.localCommit(ServerTransactionImpl.java:1803)
         at weblogic.transaction.internal.ServerTransactionImpl.globalRetryCommit(ServerTransactionImpl.java:2434)
         at weblogic.transaction.internal.ServerTransactionImpl.globalCommit(ServerTransactionImpl.java:2365)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:278)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:244)
         at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:299)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:110)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection

    Durga Gokina wrote:
    Every day we get closed connection exceptions (which I think in turn leads to Heuristic Hazard exceptions), the first time we run the tests after restarting Weblogic and database.
    I tried various WL parameters so far but not with much luck. The parameters I tried include setting "Test Reserved Connections", "Test Created Connections", "Test Released Connections", "Connection Creation Retry Frequency", disabling "Allow Shrinking" etc.
    I tried weblogic support but so far not much progress. Any help is greatly appreciated. Following are the log traces.
    Server.log Fragment:Hi. The jdbc log shows that some native code error is killing your type-2 JDBC connection,
    and depending on what C bug it is, it could corrupt any other native connection or code.
    I highly recommend you switch to a type-4 driver.
    Joe
    ####<Mar 23, 2005 12:06:30 AM UTC> <Error> <JDBC> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <> <BEA-001112> <Test "select count(*) from dual" set up for pool "TruthPool" failed with exception: "java.sql.SQLException: Closed Connection".>
    ####<Mar 23, 2005 12:06:30 AM UTC> <Info> <JDBC> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <> <BEA-001128> <Connection for pool "TruthPool" closed.>
    ####<Mar 23, 2005 12:06:31 AM UTC> <Info> <JDBC> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <> <BEA-001067> <Connection for pool "TruthPool" refreshed.>
    ####<Mar 23, 2005 12:06:31 AM UTC> <Error> <JTA> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <BEA1-1B44D3A1A2E1DF26344B> <BEA-110412> <Name=[EJB com.opsware.list.PaginatedListBean.getList(int,int)],Xid=BEA1-1B44D3A1A2E1DF26344B(6341523),Status=Committed,HeuristicErrorCode=XA_HEURHAZ,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=2,seconds left=119,activeThread=Thread[ExecuteThread: '26' for queue: 'default',5,Thread Group for Queue: 'default'],XAS
    erverResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=committed,assigned=twist),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@c806dc,re-Registered = false),SCInfo[twist_domain+twist]=(state=committed),properties=({weblogic.transaction.name=[EJB com.opsware.list.PaginatedListBean.getList(int,int)], weblogic.jdbc=t3://192.168.198.5:1026}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=twist+192.168.198.5:102
    6+twist_domain+t3+, XAResources={},NonXAResources={})],CoordinatorURL=twist+192.168.198.5:1026+twist_domain+t3+) completed heuristically: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Closed Connection)) >
    ####<Mar 23, 2005 12:06:31 AM UTC> <Error> <EJB> <m184.dev.opsware.com> <twist> <ExecuteThread: '26' for queue: 'default'> <<anonymous>> <> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB com.opsware.list.PaginatedListBean.getList(int,int)],Xid=BEA1-1B44D3A1A2E1DF26344B(6341523),Status=Committed,HeuristicErrorCode=XA_HEURHAZ,numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=2,seconds left=119,XAServerResourceInfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(ServerResourceI
    nfo[weblogic.jdbc.wrapper.JTSXAResourceImpl]=(state=committed,assigned=twist),xar=weblogic.jdbc.wrapper.JTSXAResourceImpl@c806dc,re-Registered = false),SCInfo[twist_domain+twist]=(state=committed),properties=({weblogic.transaction.name=[EJB com.opsware.list.PaginatedListBean.getList(int,int)], weblogic.jdbc=t3://192.168.198.5:1026}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=twist+192.168.198.5:1026+twist_domain+t3+, XAResources={},NonXAResources={})],CoordinatorURL=twist
    +192.168.198.5:1026+twist_domain+t3+): javax.transaction.HeuristicMixedException: (weblogic.jdbc.wrapper.JTSXAResourceImpl, HeuristicHazard, (javax.transaction.xa.XAException: Closed Connection))
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:294)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:244)
         at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:299)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:110)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    .>
    JDBC Log:
    JDBC log stream started at Tue Mar 22 22:44:30 UTC 2005
    DriverManager.initialize: jdbc.drivers = null
    JDBC DriverManager initialized
    registerDriver: driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@29a046]
    DriverManager.getDriver("jdbc:oracle:oci:@")
    trying driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@29a046]
    getDriver returning driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@29a046]
    registerDriver: driver[className=weblogic.jdbc.jts.Driver,weblogic.jdbc.jts.Driver@1c68b20]
    registerDriver: driver[className=weblogic.jdbc.pool.Driver,weblogic.jdbc.pool.Driver@f0b51d]
    SQLException: SQLState(23000) vendor code(1)
    java.sql.SQLException: ORA-00001: unique constraint (TRUTH.TMP$ACCT_ID_PK) violated
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:630)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_describe(T2CPreparedStatement.java:851)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_rows(T2CPreparedStatement.java:1012)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8661)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:137)
         at com.opsware.utils.SQLHelper.setFilterIds(SQLHelper.java:90)
         at com.opsware.utils.SQLHelper.setFilterAcctIds(SQLHelper.java:45)
         at com.opsware.list.impl.device.DeviceBaseList.getQuery(DeviceBaseList.java:178)
         at com.opsware.list.impl.device.DeviceBaseList.getIds(DeviceBaseList.java:50)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getDeviceIds(DeviceServerGroupViewList.java:145)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getIds(DeviceServerGroupViewList.java:47)
         at com.opsware.list.PaginatedListBean.init(PaginatedListBean.java:77)
         at com.opsware.list.PaginatedListBean.getSize(PaginatedListBean.java:216)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getSize(PaginatedList_mywl9s_EOImpl.java:154)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(23000) vendor code(1)
    java.sql.BatchUpdateException: ORA-00001: unique constraint (TRUTH.TMP$ACCT_ID_PK) violated
         at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8726)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:137)
         at com.opsware.utils.SQLHelper.setFilterIds(SQLHelper.java:90)
         at com.opsware.utils.SQLHelper.setFilterAcctIds(SQLHelper.java:45)
         at com.opsware.list.impl.device.DeviceBaseList.getQuery(DeviceBaseList.java:178)
         at com.opsware.list.impl.device.DeviceBaseList.getIds(DeviceBaseList.java:50)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getDeviceIds(DeviceServerGroupViewList.java:145)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getIds(DeviceServerGroupViewList.java:47)
         at com.opsware.list.PaginatedListBean.init(PaginatedListBean.java:77)
         at com.opsware.list.PaginatedListBean.getSize(PaginatedListBean.java:216)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getSize(PaginatedList_mywl9s_EOImpl.java:154)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(23000) vendor code(1)
    java.sql.SQLException: ORA-00001: unique constraint (TRUTH.TMP$DATA_CENTER_ID_PK) violated
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:630)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_describe(T2CPreparedStatement.java:851)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_rows(T2CPreparedStatement.java:1012)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8661)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:137)
         at com.opsware.utils.SQLHelper.setFilterIds(SQLHelper.java:90)
         at com.opsware.utils.SQLHelper.setFilterDcIds(SQLHelper.java:36)
         at com.opsware.list.impl.device.DeviceBaseList.getQuery(DeviceBaseList.java:196)
         at com.opsware.list.impl.device.DeviceBaseList.getIds(DeviceBaseList.java:50)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getDeviceIds(DeviceServerGroupViewList.java:145)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getIds(DeviceServerGroupViewList.java:47)
         at com.opsware.list.PaginatedListBean.init(PaginatedListBean.java:77)
         at com.opsware.list.PaginatedListBean.getSize(PaginatedListBean.java:216)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getSize(PaginatedList_mywl9s_EOImpl.java:154)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(23000) vendor code(1)
    java.sql.BatchUpdateException: ORA-00001: unique constraint (TRUTH.TMP$DATA_CENTER_ID_PK) violated
         at oracle.jdbc.driver.DatabaseError.throwBatchUpdateException(DatabaseError.java:367)
         at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:8726)
         at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:137)
         at com.opsware.utils.SQLHelper.setFilterIds(SQLHelper.java:90)
         at com.opsware.utils.SQLHelper.setFilterDcIds(SQLHelper.java:36)
         at com.opsware.list.impl.device.DeviceBaseList.getQuery(DeviceBaseList.java:196)
         at com.opsware.list.impl.device.DeviceBaseList.getIds(DeviceBaseList.java:50)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getDeviceIds(DeviceServerGroupViewList.java:145)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getIds(DeviceServerGroupViewList.java:47)
         at com.opsware.list.PaginatedListBean.init(PaginatedListBean.java:77)
         at com.opsware.list.PaginatedListBean.getSize(PaginatedListBean.java:216)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getSize(PaginatedList_mywl9s_EOImpl.java:154)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(42000) vendor code(936)
    java.sql.SQLException: ORA-00936: missing expression
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:630)
         at oracle.jdbc.driver.T2CStatement.execute_for_describe(T2CStatement.java:841)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:894)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:984)
         at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1124)
         at weblogic.jdbc.wrapper.Statement.executeQuery(Statement.java:345)
         at com.opsware.impl.servergroup.ServerGroupSQL.refreshLocalCoreMemberships(ServerGroupSQL.java:897)
         at com.opsware.ejb.session.ServerGroupFacadeBean.refreshMembershipsInLocalCore(ServerGroupFacadeBean.java:497)
         at com.opsware._gen.sejb.ejb.session._ServerGroupFacadeBean._opsw__refreshMembershipsInLocalCore(_ServerGroupFacadeBean.java:10715)
         at com.opsware._gen.sejb.ejb.session.ServerGroupFacade_686jy5_EOImpl._opsw__refreshMembershipsInLocalCore(ServerGroupFacade_686jy5_EOImpl.java:8902)
         at com.opsware._gen.client.ejb.session._ServerGroupFacadeStub._opsw__refreshMembershipsInLocalCore(_ServerGroupFacadeStub.java:5096)
         at com.opsware._gen.client.ejb.session._ServerGroupFacadeStub.refreshMembershipsInLocalCore(_ServerGroupFacadeStub.java:5091)
         at com.opsware.impl.groupevent.Recalc.performFullRecalc(Recalc.java:204)
         at com.opsware.impl.groupevent.Recalc$1.run(Recalc.java:573)
         at java.lang.Thread.run(Thread.java:534)
    SQLException: SQLState(60000) vendor code(600)
    java.sql.SQLException: ORA-00600: internal error code, arguments: [kpofdr-long], [], [], [], [], [], [], []
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:630)
         at oracle.jdbc.driver.T2CPreparedStatement.doDefineExecuteFetch(T2CPreparedStatement.java:1135)
         at oracle.jdbc.driver.T2CPreparedStatement.execute_for_rows(T2CPreparedStatement.java:1010)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:913)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2885)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:2926)
         at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:92)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.ejbFindByDvcRoleAndKey(DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.java:652)
         at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.scalarFinder(RDBMSPersistenceManager.java:294)
         at weblogic.ejb20.manager.BaseEntityManager.scalarFinder(BaseEntityManager.java:1662)
         at weblogic.ejb20.manager.BaseEntityManager.localScalarFinder(BaseEntityManager.java:1611)
         at weblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:462)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g_LocalHomeImpl.findByDvcRoleAndKey(DeviceRoleConfig_bbuo9g_LocalHomeImpl.java:132)
         at com.opsware.impl.device.DeviceUtil.getAttributeNL(DeviceUtil.java:224)
         at com.opsware.impl.device.DeviceUtil.getLockUser(DeviceUtil.java:308)
         at com.opsware.vo.DeviceBaseVO.<init>(DeviceBaseVO.java:42)
         at com.opsware.vo.DeviceSWVO.<init>(DeviceSWVO.java:21)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getList(DeviceServerGroupViewList.java:173)
         at com.opsware.list.PaginatedListBean.getSubList(PaginatedListBean.java:173)
         at com.opsware.list.PaginatedListBean.getList(PaginatedListBean.java:124)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:100)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:698)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:615)
         at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:1133)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:966)
         at weblogic.jdbc.wrapper.PreparedStatement.reCreateStatement(PreparedStatement.java:48)
         at weblogic.jdbc.wrapper.Statement.checkStatement(Statement.java:237)
         at weblogic.jdbc.wrapper.Statement.close(Statement.java:300)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.releaseStatement(RDBMSPersistenceManager.java:3419)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.releaseResources(RDBMSPersistenceManager.java:3300)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.ejbFindByDvcRoleAndKey(DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.java:703)
         at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.scalarFinder(RDBMSPersistenceManager.java:294)
         at weblogic.ejb20.manager.BaseEntityManager.scalarFinder(BaseEntityManager.java:1662)
         at weblogic.ejb20.manager.BaseEntityManager.localScalarFinder(BaseEntityManager.java:1611)
         at weblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:462)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g_LocalHomeImpl.findByDvcRoleAndKey(DeviceRoleConfig_bbuo9g_LocalHomeImpl.java:132)
         at com.opsware.impl.device.DeviceUtil.getAttributeNL(DeviceUtil.java:224)
         at com.opsware.impl.device.DeviceUtil.getLockUser(DeviceUtil.java:308)
         at com.opsware.vo.DeviceBaseVO.<init>(DeviceBaseVO.java:42)
         at com.opsware.vo.DeviceSWVO.<init>(DeviceSWVO.java:21)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getList(DeviceServerGroupViewList.java:173)
         at com.opsware.list.PaginatedListBean.getSubList(PaginatedListBean.java:173)
         at com.opsware.list.PaginatedListBean.getList(PaginatedListBean.java:124)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:100)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:698)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:615)
         at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:1133)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:966)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:905)
         at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:350)
         at weblogic.jdbc.wrapper.JTSConnection.prepareStatement(JTSConnection.java:479)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.ejbFindByDvcRoleAndKey(DeviceRoleConfig_bbuo9g__WebLogic_CMP_RDBMS.java:632)
         at sun.reflect.GeneratedMethodAccessor169.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.scalarFinder(RDBMSPersistenceManager.java:294)
         at weblogic.ejb20.manager.BaseEntityManager.scalarFinder(BaseEntityManager.java:1662)
         at weblogic.ejb20.manager.BaseEntityManager.localScalarFinder(BaseEntityManager.java:1611)
         at weblogic.ejb20.internal.EntityEJBLocalHome.finder(EntityEJBLocalHome.java:462)
         at com.opsware.ejb.DeviceRoleConfig_bbuo9g_LocalHomeImpl.findByDvcRoleAndKey(DeviceRoleConfig_bbuo9g_LocalHomeImpl.java:132)
         at com.opsware.impl.device.DeviceUtil.getAttributeNL(DeviceUtil.java:224)
         at com.opsware.impl.device.DeviceUtil.getLockComment(DeviceUtil.java:316)
         at com.opsware.vo.DeviceBaseVO.<init>(DeviceBaseVO.java:43)
         at com.opsware.vo.DeviceSWVO.<init>(DeviceSWVO.java:21)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getList(DeviceServerGroupViewList.java:173)
         at com.opsware.list.PaginatedListBean.getSubList(PaginatedListBean.java:173)
         at com.opsware.list.PaginatedListBean.getList(PaginatedListBean.java:124)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:100)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:698)
         at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:615)
         at weblogic.jdbc.common.internal.ConnectionEnv.makeStatement(ConnectionEnv.java:1133)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:966)
         at weblogic.jdbc.common.internal.ConnectionEnv.getCachedStatement(ConnectionEnv.java:905)
         at weblogic.jdbc.wrapper.Connection.prepareStatement(Connection.java:350)
         at weblogic.jdbc.wrapper.JTSConnection.prepareStatement(JTSConnection.java:479)
         at com.opsware.ejb.RoleClassWads_opugk0__WebLogic_CMP_RDBMS.ejbFindByRoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads__WL_(RoleClassWads_opugk0__WebLogic_CMP_RDBMS.java:1510)
         at sun.reflect.GeneratedMethodAccessor256.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.collectionFinder(RDBMSPersistenceManager.java:378)
         at weblogic.ejb20.manager.BaseEntityManager.wrapperSetFinder(BaseEntityManager.java:1888)
         at weblogic.ejb20.manager.BaseEntityManager.localWrapperSetFinder(BaseEntityManager.java:1859)
         at com.opsware.ejb.RoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads_Set.populateCache(RoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads_Set.java:111)
         at com.opsware.ejb.RoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads_Set.iterator(RoleClasses_nx2si8__WebLogic_CMP_RDBMS_roleClassWads_Set.java:177)
         at com.opsware.vo.DeviceSWVO.<init>(DeviceSWVO.java:35)
         at com.opsware.list.impl.device.DeviceServerGroupViewList.getList(DeviceServerGroupViewList.java:173)
         at com.opsware.list.PaginatedListBean.getSubList(PaginatedListBean.java:173)
         at com.opsware.list.PaginatedListBean.getList(PaginatedListBean.java:124)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl.getList(PaginatedList_mywl9s_EOImpl.java:100)
         at com.opsware.list.PaginatedList_mywl9s_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:90)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
         at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    SQLException: SQLState(null) vendor code(17008)
    java.sql.SQLException: Closed Connection
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
         at oracle.jdbc.driver.PhysicalConnection.commit(PhysicalConnection.java:964)
         at weblogic.jdbc.wrapper.JTSConnection.internalCommit(JTSConnection.java:404)
         at weblogic.jdbc.wrapper.JTSXAResourceImpl.commit(JTSXAResourceImpl.java:56)
         at weblogic.transaction.internal.XAServerResourceInfo.commit(XAServerResourceInfo.java:1251)
         at weblogic.transaction.internal.XAServerResourceInfo.commit(XAServerResourceInfo.java:482)
         at weblogic.transaction.internal.ServerSCInfo.startCommit(ServerSCInfo.java:421)
         at weblogic.transaction.internal.ServerTransactionImpl.localCommit(ServerTransactionImpl.java:1803)
         at weblogic.transaction.internal.ServerTransactionImpl.globalRetryCommit(ServerTransactionImpl.java:2434)
         at weblogic.transaction.internal.ServerTransactionImpl.globalCommit(ServerTransactionImpl.java:2365)
         at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:278)
         at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:244)
         at weblogic.ejb20.internal.Bas

  • JDBC Statement.executeBatch() sometimes retrun NULL????

    WHY???? DataBase is ORACLE8.1.7
    i use PreparedStatement to executeBatch()
    and DatabaseMetaData.supportsBatchUpdates() = true
    but sometimes executeBatch() = NULL !!!!
    is this respect with ORACLE parameter?

    thanx for nobody's help.
    i solved problem. it is a synchronization problem.
    public synchronized void getTable(JTable theTable){
    try {
    String sql="SELECT ";
    stmt=connection.createStatement();
    rs=stmt.executeQuery(sql);
    displayRS(rs,theTable);
    stmt.close();
    catch (Exception e ) {
    e.printStackTrace();
    }

  • Can not add nodes (content and folder) into repositories

    Hi all,
    I have configured MS SQL database with WebLogic portal 10.2 without any error.
    Then i successfully created around 142 nodes under repository. But after that, when i try to create any new node
    server is throwing following exception:
    <Mar 26, 2009 8:07:32 PM GMT+05:30> <Error> <ContentManagement> <BEA-000000> <
    com.bea.content.RepositoryException: weblogic.jdbc.base.BaseBatchUpdateException: [BEA][SQLServer JDBC Driver][SQLServer]Violation of PRIMARY KEY constraint 'PK_CM_PROPERTY'. Cannot insert duplicate key in object 'dbo.CM_PROPERTY'.
    at com.bea.content.internal.server.common.dbaction.Batcher.processWithRetries(Batcher.java:132)
    at com.bea.content.internal.server.common.dbaction.Batcher.processAnyRemainingItems(Batcher.java:70)
    at com.bea.content.repo.internal.server.dao.PropertyDao.insert(PropertyDao.java:335)
    at com.bea.content.repo.internal.server.persister.JDBCNodePersister.createNode(JDBCNodePersister.java:121)
    at com.bea.content.repo.internal.server.logic.NodeOpsLogic.create(NodeOpsLogic.java:204)
    Truncated. see log file for complete stacktrace
    weblogic.jdbc.base.BaseBatchUpdateException: [BEA][SQLServer JDBC Driver][SQLServer]Violation of PRIMARY KEY constraint 'PK_CM_PROPERTY'. Cannot insert duplicate key in object 'dbo.CM_PROPERTY'.
    at weblogic.jdbc.sqlserver.SQLServerImplStatement.getBatchRowsAffectedCount(Unknown Source)
    at weblogic.jdbc.base.BasePreparedStatement.executeBatch(Unknown Source)
    at weblogic.jdbcx.base.BaseStatementWrapper.executeBatch(Unknown Source)
    at weblogic.jdbc.wrapper.PreparedStatement.executeBatch(PreparedStatement.java:154)
    at com.bea.content.internal.server.common.dbaction.Batcher.processWithRetries(Batcher.java:114)
    Truncated. see log file for complete stacktrace
    >
    Exception: com.bea.content.RepositoryException: weblogic.jdbc.base.BaseBatchUpdateException: [BEA][SQLServer JDBC Driver][SQLServer]Violation of PRIMARY KEY constraint 'PK_CM_PROPERTY'. Cannot insert duplicate key in object 'dbo.CM_PROPERTY'.
    But after cleaning CM_PROPERTY table from database, i could successfully create any new node.
    Why i am not able to create more than 142 nodes in repository?

    Here's some snippets of a valid SQL*Server config which shows some of the important transaction-related settings regarding how the <domain>/config/jdbc/*.xml scripts should be configured:
    - portalDataSourceNeverXA-jdbc.xml:
    <driver-name>weblogic.jdbc.sqlserver.SQLServerDriver</driver-name>
         <jdbc-data-source-params>
              <global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
         </jdbc-data-source-params>
    - portalDataSource-jdbc.xml:
    <driver-name>weblogic.jdbc.sqlserver.SQLServerDriver</driver-name>
         <jdbc-data-source-params>
              <global-transactions-protocol>OnePhaseCommit</global-transactions-protocol>
         </jdbc-data-source-params>
    - portalDataSourceAlwaysXA-jdbc.xml
    <driver-name>weblogic.jdbcx.sqlserver.SQLServerDataSource</driver-name>
         <jdbc-data-source-params>
    <global-transactions-protocol>TwoPhaseCommit</global-transactions-protocol>
         </jdbc-data-source-params>
    - p13nDataSource-jdbc.xml
              <driver-name>weblogic.jdbc.sqlserver.SQLServerDriver</driver-name>
         <jdbc-data-source-params>
              <global-transactions-protocol>None</global-transactions-protocol>
         </jdbc-data-source-params>
    - cgDataSource-nonXA-jdbc.xml
    <driver-name>weblogic.jdbc.sqlserver.SQLServerDriver</driver-name>
    <jdbc-data-source-params>
    <global-transactions-protocol>None</global-transactions-protocol>
    </jdbc-data-source-params>
    - cgDataSource-jdbc.xml
    <driver-name>weblogic.jdbc.sqlserver.SQLServerDriver</driver-name>
    <jdbc-data-source-params>
    <global-transactions-protocol>EmulateTwoPhaseCommit</global-transactions-protocol>
    </jdbc-data-source-params>
    Also please take a look at the Database Administration guide at http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/db/index.html -- it describes the process for creating the tables in your SQL*Server schema (necessary unless you do that via the config wizard)
    -Steve

  • How to read from BLOB and Write to a file in user readable format.

    Hi,
         I am trying to read from a BLOB column and write the content to a file in user readable format. So far I was able to read the Blob column using dbms_lob, but not able to write to a file. Kindly let me know the method to do this.

    Hi, with this Java Code from Oracle Technet it's a easy thing:
    // classpath= /ORACLE/u01/app/oracle/product/10.2.0.3/jdbc/lib/ojdbc14.jar
    // Java SQL classes
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.Statement;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    // Oracle JDBC driver class
    import oracle.jdbc.OracleDriver;
    // Java IO classes
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    //Java Util classes
    import java.util.Properties;
    * This class demonstrates the Oracle JDBC 10g enhanced features for inserting
    * and retrieving CLOB data from the database. Using the new features, large
    * data of more than 32765 bytes can be inserted into the database using the
    * existing PreparedStatement.setString() and PreparedStatement.getString()
    * methods.
    public class ClobMan {
    /* Database Connection object */
    private Connection conn = null;
    /* Variables to hold database details */
    private String url = null;
    private String user = null;
    private String password = null;
    // Create a property object to hold the username, password and
    // the new property SetBigStringTryClob.
    private Properties props = new Properties();
    /* String to hold file name */
    private String fileName = null;
    * Default Constructor to instantiate and get a handle to class methods
    * and variables.
    public ClobMan(String fileName) {
    this.fileName = fileName;
    * Main runnable class.
    public static void main(String[] args) throws SQLException {
    // Instantiate the main class.
    ClobMan clobMan = new ClobMan(args[0]);
    // Load the Oracle JDBC driver class.
    DriverManager.registerDriver(new OracleDriver());
    // Load the database details into the variables.
    String dbUrl = "jdbc:oracle:thin:@pmol:1550:dbpmol";
    clobMan.url = dbUrl;
    clobMan.user = "gh10";
    clobMan.password = "secret";
    // Populate the property object to hold the username, password and
    // the new property 'SetBigStringTryClob' which is set to true. Setting
    // this property allows inserting of large data using the existing
    // setString() method, to a CLOB column in the database.
    clobMan.props.put("user", clobMan.user );
    clobMan.props.put("password", clobMan.password);
    clobMan.props.put("SetBigStringTryClob", "true");
    // Check if the table 'CLOB_TAB' is present in the database.
    //clobMan.checkTables();
    // Call the methods to insert and select CLOB from the database.
    //clobMan.insertClob();
    clobMan.selectClob();
    * This method will insert the data into a CLOB column in the database.
    * Oracle JDBC 10g has enhanced the existing PreparedStatement.setString()
    * method for setting the data more than 32765 bytes. So, using setString(),
    * it is now easy to insert CLOB data into the database directly.
    private void insertClob() throws SQLException {
    // Create a PreparedStatement object.
    PreparedStatement pstmt = null;
    try {
    // Create the database connection, if it is closed.
    if ((conn==null)||conn.isClosed()){
    // Connect to the database.
    conn = DriverManager.getConnection( this.url, this.props );
    // Create SQL query to insert data into the CLOB column in the database.
    String sql = "INSERT INTO clob_tab VALUES(?)";
    // Read a big file(larger than 32765 bytes)
    String str = this.readFile();
    // Create the OraclePreparedStatement object
    pstmt = conn.prepareStatement(sql);
    // Use the same setString() method which is enhanced to insert
    // the CLOB data. The string data is automatically transformed into a
    // clob and inserted into the database column. Make sure that the
    // Connection property - 'SetBigStringTryClob' is set to true for
    // the insert to happen.
    pstmt.setString(1,str);
    // Execute the PreparedStatement
    pstmt.executeUpdate();
    } catch (SQLException sqlex) {
    // Catch Exceptions and display messages accordingly.
    System.out.println("SQLException while connecting and inserting into " +
    "the database table: " + sqlex.toString());
    } catch (Exception ex) {
    System.out.println("Exception while connecting and inserting into the" +
    " database table: " + ex.toString());
    } finally {
    // Close the Statement and the connection objects.
    if (pstmt!=null) pstmt.close();
    if (conn!=null) conn.close();
    * This method reads the CLOB data from the database by using getString()
    * method.
    private void selectClob() throws SQLException {
    // Create a PreparedStatement object
    PreparedStatement pstmt = null;
    // Create a ResultSet to hold the records retrieved.
    ResultSet rset = null;
    try {
    // Create the database connection, if it is closed.
    if ((conn==null)||conn.isClosed()){
    // Connect to the database.
    conn = DriverManager.getConnection( this.url, this.props );
    // Create SQL query statement to retrieve records having CLOB data from
    // the database.
    String sqlCall = "SELECT rownum, name, sourcetext FROM t_source";
    pstmt= conn.prepareStatement(sqlCall);
    // Execute the PrepareStatement
    rset = pstmt.executeQuery();
    String rownum = null;
    String o_name =null;
    String clobVal = null;
    // Get the CLOB value from the resultset
    //java.io.BufferedWriter out = new java.io.BufferedWriter(new java.io.FileWriter("pr_all.sql"));
    while (rset.next()) {
    rownum = rset.getString(1);
         o_name = rset.getString(2);
         clobVal = rset.getString(3);
    System.out.println(" length: "+clobVal.length()+" "+o_name+" "+rownum);
         java.io.BufferedWriter out =
         new java.io.BufferedWriter(new java.io.FileWriter(o_name+".prc"));
         out.write(clobVal);
         out.newLine();
         out.write("/");
         out.newLine();
         out.newLine();
    out.flush();
    out.close();
    } catch (SQLException sqlex) {
    // Catch Exceptions and display messages accordingly.
    System.out.println("SQLException while connecting and querying the " +
    "database table: " + sqlex.toString());
    } catch (Exception ex) {
    System.out.println("Exception while connecting and querying the " +
    "database table: " + ex.toString());
    } finally {
    // Close the resultset, statement and the connection objects.
    if (rset !=null) rset.close();
    if (pstmt!=null) pstmt.close();
    if (conn!=null) conn.close();
    * Method to check if the table ('CLOB_TAB') exists in the database; if not
    * then it is created.
    * Table Name: CLOB_TAB
    * Column Name Type
    * col_col CLOB
    private void checkTables() {
    Statement stmt = null;
    ResultSet rset = null;
    try {
    // Create the database connection, if it is closed.
    if ((conn==null)||conn.isClosed()){
    // Connect to the database.
    conn = DriverManager.getConnection( this.url, this.props );
    // Create Statement object
    stmt = conn.createStatement();
    // Check if the table is present
    rset = stmt.executeQuery(" SELECT table_name FROM user_tables "+
    " WHERE table_name = 'CLOB_TAB' ");
    // If the table is not present, then create the table.
    if (!rset.next()) {
    // Table does not exist, create it
    stmt.executeUpdate(" CREATE TABLE clob_tab(clob_col CLOB)");
    } catch (SQLException sqlEx) {
    System.out.println("Could not create table clob_tab : "
    +sqlEx.toString());
    } finally {
    try {
    if( rset != null ) rset.close();
    if( stmt != null ) stmt.close();
    if (conn!=null) conn.close();
    } catch(SQLException ex) {
    System.out.println("Could not close objects in checkTables method : "
    +ex.toString());
    * This method reads the specified text file and, returns the content
    * as a string.
    private String readFile()
    throws FileNotFoundException, IOException{
    // Read the file whose content has to be passed as String
    BufferedReader br = new BufferedReader(new FileReader(fileName));
    String nextLine = "";
    StringBuffer sb = new StringBuffer();
    while ((nextLine = br.readLine()) != null) {
    sb.append(nextLine);
    // Convert the content into to a string
    String clobData = sb.toString();
    // Return the data.
    return clobData;
    }

  • PreparedStatement loses negative sign?!?: setInt()/setObject()

    I have 3 sql statements in my application (1 select/1 update and 1 insert) where I've noticed that after some time of working properly, all of a sudden these statements stop handling negative integers and instead process them as positive integers.
    i.e. the select statement would return result as if the where clause parameter was positive instead of negative, the insert statement would actually insert the number as a positive, etc... The only way for me to fix the problem is the restart the iPlanet application server (connecting to an oracle 8.1.7 db using the oracle 8.1.7 jdbc)
    I log the parameters from the PreparedStatement setInt() and setObject() comments just before execution and clearly the values are logged as negatives.
    e.g. (not the actual source code, but the same idea)
    PreparedStatement pstmt =
    conn.prepareStatement ("insert into testTable (anInt, name) values (?,?)");
    int anInt = -1;
    String name = "test";
    System.out.println("Before insert: " + anInt + " " + name); // outputs Before insert: -1 test
    pstmt.setInt(1, anInt);
    pstmt.setString (2, name);
    pstmt.execute ();
    ====================
    select * testTable;
    anInt name
    ===========
    1 test
    Any ideas?
    regards,
    Rob

    Did the author of the original posting (Rob Terro) ever learn anything about the nature of this problem and the appropriate fix?
    We are observing what sounds like the same behavior: after some time of working properly, all of the sudden stored procedures to which we pass negative parameters (in particular, -1) in Java start receiving these as positive parameters at the database.
    We are using the Oracle JDBC 8.1.6 thin driver, running on Solaris 5.9 generic_112233-03, using the Sun HotSpot JVM, version 1.3.1_07.
    We had been running with this configuration for some time without apparent problems. Recently, we added to the command line the JVM "-server -Xconcurrentio" options. These greatly improved performance, but apparently lead to this problem of losing negative signs when talking to Oracle. However, the problem appears erratically, so we are not 100% certain that these options cause the problem. Also, we would ideally like to hang on to the performance gains produced by using these options.
    How does this configuration compare to the configuration used by the original poster when he encountered this problem?
    Does anyone have insight into the possible nature of this problem?

  • My CLOB insert with PreparedStatements WORKS but is SLOOOOWWW

    Hi All,
    I am working on an application which copies over a MySQL database
    to an Oracle database.
    I got the code to work including connection pooling, threads and
    PreparedStatements. For tables with CLOBs in them, I go through the
    extra process of inserting the CLOBs according to Oracle norm, i.e.
    getting locator and then writing to that:
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html (Good Example for BLOBs, CLOBs)
    However, for tables with such CLOBs, I only get a Record per second insert
    of about 1/sec!!! Tables without CLOBs (and thus, without the round-about-way)
    of inserting CLOBs are approx. 10/sec!!
    How can I improve the speed of my clob inserts / improve the code? At the moment, for
    a table of 30,000 records (with CLOBs) it takes about 30,000 which is 8 hours!!!!
    Here is my working code, which is run when my application notices that the table has
    CLOBs. The record has already been inserted with all non-clob fields and the "EMPTY_BLOB()"
    blank for the CLOB. The code then selects that row (the one just inserted), gets a handle on the
    EMPTY_BLOB location and writes the my CLOB content (over 4000 characters) to that handles
    and then closes the handle. At the very end, I do conn.commit().
    Any tips for improving speed?
    conn.setAutoCommit(false);
    * This first section is Pseudo-Code. The actual code is pretty straight
    * forward. (1) I create the preparedStatement, (2) I go record by record
    * - for each record, I (a) loop through each column and run the corresponding
    * setXXX to set the preparedStatement parameters, (b) run
    * preparedStatement.executeUpdate(), and (c) if CLOB is present, run below
    * actual code.
    * During insertion of the record (executeUpdate), if I notice that
    * a Clob needs to be inserted, I insert a "EMPTY_CLOB()" placeholder and set
    * the flag "clobInTheHouse" to true. Once the record is inserted, if "clobInTheHouse"
    * is actually "true," I go to the below code to insert the Blob into that
    * newly created record's "EMPTY_CLOB()" placeholder
    // clobSelect = "SELECT * FROM tableName WHERE "uniqueRecord" LIKE '1'
    // I create the above for each record I insert and have this special uniqueRecord value to
    // identify what record that is so I can get it below. clobInTheHouse is true when, where I
    // insert the records, I find that there is a CLOB that needs to be inserted.
    if(clobInTheHouse){
         ResultSet lobDetails = stmt.executeQuery(clobSelect);
         ResultSetMetaData rsmd = lobDetails.getMetaData();
         if(lobDetails.next()){
              for(int i = 1; i <= rsmd.getColumnCount(); i++){
                 // if column name matches clob name, then go and do the rest
                   if(clobs.contains(rsmd.getColumnName(i))){
                        Clob theClob = lobDetails.getClob(i);
                        Writer clobWriter = ((oracle.sql.CLOB)theClob).getCharacterOutputStream();
                        StringReader clobReader = new StringReader((String) clobHash.get(rsmd.getColumnName(i)));
                        char[] cbuffer = new char[30* 1024]; // Buffer to hold chunks of data to be written to Clob, the slob
                        int nread = 0;
                        try{
                             while((nread=clobReader.read(cbuffer)) != -1){
                                  clobWriter.write(cbuffer,0,nread);
                        }catch(IOException ioe){
                           System.out.println("E: clobWriter exception - " + ioe.toString());
                        }finally{
                             try{
                                  clobReader.close();
                                  clobWriter.close();
                                  //System.out.println("   Clob-slob entered for " + tableName);
                             }catch(IOException ioe2){
                                  System.out.println("E: clobWriter close exception - " + ioe2.toString());
         try{
              stmt.close();
         }catch(SQLException sqle2){
    conn.commit();

    Can you use insert .. returning .. so you do not have to select the empty_clob back out.
    [I have a similar problem but I do not know the primary key to select on, I am really looking for an atomic insert and fill clob mechanism, somone said you can create a clob fill it and use that in the insert, but I have not seen an example yet.]

  • PreparedStatement & ODBC

    Does the JDBC-ODBC bridge driver support PreparedStatement INSERTS and UPDATES? I've been getting the following error:
    "java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Optional feature not implemented"
    Is this associated with the driver or a query statement structure problem?
    Thanks
    Tom B.

    Does the JDBC-ODBC bridge driver support
    PreparedStatement INSERTS and UPDATES?Yes, it does. I have used them.
    "java.sql.SQLException: [Microsoft][ODBC SQL Server
    Driver]Optional feature not implemented"
    Is this associated with the driver or a query
    statement structure problem?It is associated with whatever line of code threw the exception, probably. Hard to say with the information given.

  • Using IN and TABLE operators via JDBC

    Greetings,
    Hope this may be of benefit to someone.
    Any and all feedback greatly appreciated.
    import java.math.BigDecimal;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import javax.sql.DataSource;
    import oracle.sql.ARRAY;
    import oracle.sql.ArrayDescriptor;
    import oracle.jdbc.pool.OracleDataSource;
    * Tests an SQL query that uses the IN operator and the TABLE keyword.
    * The TABLE keyword transforms a PL/SQL collection into a regular table.
    * Hence a query can use the IN operator with a PL/SQL collection.
    * A PL/SQL collection maps to a java array.
    * Hence you can execute a query using a <code>PreparedStatement</code> and an
    * array as the parameter value.
    * Note, however, that the PL/SQL collection type <em>must</em> be a database
    * named type, one that is defined using the CREATE TYPE [DDL] statement.
    public class SqlQuery {
      public static void main(String[] args) {
        Connection c = null;
        Object[] oa = new Object[3];
        oa[0] = new BigDecimal("9712061");
        oa[1] = new BigDecimal("9712062");
        oa[2] = new BigDecimal("9712063");
        PreparedStatement ps = null;
        ResultSet rs = null;
        String sql = "select ENAME " +
                       "from EMP " +
                      "where EMPNO in (" +
                                      "select * " +
                                        "from table(?)" +
        String url = "jdbc:oracle:thin:scott/tiger@//localhost:1521/orcl";
        try {
          OracleDataSource ods = new OracleDataSource();
          ods.setURL(url);
          c = ods.getConnection();
          ArrayDescriptor ad = ArrayDescriptor.createDescriptor(
                                                           "<nested table type name>",
                                                           c);
          ARRAY a = new ARRAY(ad, c, (Object) oa);
          ps = c.prepareStatement(sql);
          ps.setArray(1, a);
          rs = ps.executeQuery();
          while (rs.next()) {
            System.out.println(rs.getString(1));
        catch (Exception x) {
          x.printStackTrace();
        finally {
          if (rs != null) {
            try {
              rs.close();
            catch (Exception x) {
              System.err.println("Failed to close result set.");
              x.printStackTrace();
          if (ps != null) {
            try {
              ps.close();
            catch (Exception x) {
              System.err.println("Failed to close statement.");
              x.printStackTrace();
          if (c != null) {
            try {
              c.close();
            catch (Exception x) {
              System.err.println("Failed to close database connection.");
              x.printStackTrace();
    }Good Luck,
    Avi.

    Thanks a lot for your replies!
    We've solved the issue by converting the de table of record type into a sys_refcursor.
    The types are now defined globally (instead of in a package) and we wrote a wrapper around the original function:
    create or replace type my_result_rec as object(
      val1 number,
      val2 number );
    create or replace type my_result_tab is table of my_result_rec;
    function my_function_wrapper(
        param1 in number,
        param2 in number
      ) return sys_refcursor is
        result sys_refcursor;
      begin
        open result for
          select * from table(my_function(param1,param2));
        return result;
      end;
    Rob

Maybe you are looking for

  • Will not boot AHT

    I have a 2002 model dual-867MHz Mirrored Drive Door Mac, which started locking up for no apparent reason after a certain amount of time. I took the logical step of downloading and burning the Apple Hardware Test CD for my Mac, and when I went into St

  • Choosing a camcorder

    I need a camcorder that has a decent zoom, image stabilization, high rate of frames per second, has to be decent in low light, decent battery life, internal hard drive with sd card slots, and it has to work with a macbook.  We will be using the camco

  • 3TB HDD, GPT, EXT4 HPA enabled, [SOLVED]

    I started my HTPC as usual, only to be greeted with "movie share" not found. I was suprised, looking at console, it seemed the kernely suddently stopped looking for my HDD. Manually mounting the HDD mount -t ext4 /dev/sdg1 /mnt                       

  • I just downloaded adobe photo shop trial version and i can't find it anywhere?

    hi i just downloaded it and i can't find where it's gone?

  • Updating VARRAYs usin PrepareStatement

    I have the folling code: // Read array from recordset ARRAY x = ttProvider.rs.getARRAY( ttProvider.X ); String b[] = (String[])x.getArray(); My problem is that I want to use the OraclePrepereStatement.setARRAY(index, ARRAY) but I dont know how to man