Java.sql.SQLException: No available resource. Wait-time expired.

Hi all,
The application platform is SunONE Application Server 7, and the database is ORACLE 9i. My Website application will raise the SQLException once a few days' running. Everything will be ok once the Application server has been restarted. The detail about the Exception is :
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr: java.sql.SQLException: No available resource. Wait-time expired.
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr:      at com.sun.enterprise.resource.JdbcDataSource.internalGetConnection(JdbcDataSource.java:251)
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr:      at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:98)
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr:      at com.tsp.gdgpo.ejbm.util.EnvUtil.getDSConnection(EnvUtil.java:72)
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr:      at com.tsp.gdgpo.ejbm.util.DirectDSUtil.getObjectsFromDS(DirectDSUtil.java:103)
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr:      at com.tsp.gdgpo.ejbm.jcsms.dam.JcsmsDDSA.getSpecialistByPage(JcsmsDDSA.java:388)
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr:      at com.tsp.gdgpo.ejbm.jcsms.sessionbeans.SpecialManagerEJBBean.listSpecialist(SpecialManagerEJBBean.java:1941)
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr:      at com.tsp.gdgpo.ejbm.jcsms.sessionbeans.SpecialManagerEJBBean_EJBObjectImpl.listSpecialist(SpecialManagerEJBBean_EJBObjectImpl.java:702)
[12/Aug/2003:10:41:03] WARNING (25931): CORE3283: stderr:      at com.tsp.gdgpo.ejbm.jcsms.sessionbeans._SpecialManagerEJBBean_EJBObjectImpl_Tie._invoke(Unknown Source)thanks for any help
Niu

Ther is a related Bug i n Oracle: Bug No. 4420032
PROBLEM STATEMENT: ------------------
The Oracle client file ojdbc_14.jar is not handling exceptions correctly. The connection pool slowly runs out of connections and hits the oracle db limit of max_sessions. Increasing the db max_sessions does not help as the number of sessions continue to increase.
The vendor developers of ct's application have identified a code problem with the Oracle client file ojdbc_14.jar. Their description follows.
The following is a technical description of the Oracle JDBC client library issue. The jar file in question is: ojdbc_14.jar. This issue is also present in the 9.2.05 and 9.2.06 versions of the client code.
The socket.close() call in TcpNTAdapter.disconnect() does not properly handle network exceptions. Where the exception should be handled within the code segment calling socket.close(), the class instead throws an exception without ensuring the socket is closed. The socket is not subsequently closed by clients of the class. This ultimately results in a connection leak. Overtime, the maximum number of Oracle database sessions is reached. The only work around for this issue in production, is to restart the effected processes.
The code segment:
public void disconnect()
throws IOException { 
socket.close();
socket = null; }
should be along the lines of:
public void disconnect()
throws IOException { 
try{  socket.close();  }
catch(IOException ioe){  throw ioe;  }
finally{  socket = null;  } }
The original code segment will not execute the statement "socket = null" when . an exception occurs. Given the fact that the exception is not subsequently processed properly, the object is never dereferenced, and the socket remains open for the life of the process. Adding this statement in the finally block . ensures the object will ultimately be destroyed by the garbage collector. . ct tested this change in their lab and found that the recommended modification successfully resolved the issue.
This problem has occurred with the previous ct's application releases, but the vendor has only recently been able to isolate the root cause. The JDBC connection pool slowly runs out of connections and hits the oracle db limit of max_sessions.
Increasing the db max_sessions does not help as the number of sessions continue to increase. This problem has been occuring in Production over the past few releases of the application, but usually the connections leak slowly. This problem can be duplicated under heavy load in just a few minutes . in the Loadtest environment.

Similar Messages

  • Cannot get Local Connection, No available resource, Wait-time expired

    Hi Friends,
    Please answer my queries below.
    Thanks and Regards
    Busincess Requirement
    I have to display a particular set of rows in a dashboard or screen, and it is being refreshed every 1 minute, also user can update from that screen displayed values.
    The below program extracts some data from database and passes to the front end through a collection where it is being displayed.
    Code Logic Flow
    1. CockpitAction calls CockpitOraDAO for database results
    2. CockpitOraDAO is a singleton class.
    3. After getting the CockpitOraDAO object, the action will then call the getLabAreaCockpitDetails() method.
    getLabAreaCockpitDetails will
         - Get the Connetion from the OracleConnectionManager class (It is a plain class with getPooledConnection() and releaseConnection() methods).
         - Execute the query and put the result to a collection
         - close the connection
         - return result to the calling action.
    This getLabAreaCockpitDetails() are called around once in every 1 minute
    So, I believe everytime a call is made to action for cockpit display, it will take the existing object of the CockpitOraDAO class and make a call to database. i.e there will be only one object of CockpitOraDAO reside in application server at any particular interval of time.
    My Understandings
    1. Only 1 object of CockpitOraDAO will reside in application server (provided it is not user longer and garbage collected) at a particular instance.
    2. Many objects of Connection will be created and destroyed.(Each time the getLabAreaCockpitDetails() method is called, we will get one connection from connection pool and in finally the Connection will be released to connection pool).
    My Problems
    It is showing the "Cannot get Local Connection, No available resource, Wait-time expired"
    after running around 1 full day.
    My doubts
    1. Can anybody say why I get this error ?
    2. There may be some connections are not closed. But I have checked at finally block, the status of the connection is closed after calling this method.
    3. There may be some problem due to the singleton instane of CockpitOraDAO, Is it affecting performance ?
    4. Is it valid that I have to make CockpitOraDAO as Singleton ?
    public class CockpitOraDAO extends DAOAdaptor //implements BISample
         private static CockpitOraDAO instance=null;
         private static boolean debug = true;
         * The below method will be used to provide the singleton intance of the CockpitOraDAO object.
         public static CockpitOraDAO getInstance()
              if (instance == null)
                   synchronized (CockpitOraDAO.class)
                        if (instance == null)
                             instance = new CockpitOraDAO();
              return instance;
         * The below method will be used to get the cockpit details of the lab area.
         * This will return collecton of sample details for the specific lab.
         public Collection getLabAreaCockpitDetails(Collection prevCockpitDetailList,Collection filterCriteria) throws Exception
         if(debug)
              System.out.println("Inside CockpitOraDAO::getLabAreaCockpitDetails() method");
              Connection conn = null;
              boolean sampleExists = false;
              PreparedStatement pstmt=null;
              ResultSet rs=null;
              String returnStr=null;
              StringBuffer sqlQuery = null;
              String tempComment1=null, tempComment2=null;
              LabCockpitDO labc=null;
              LabCockpitDO labc2=null;
              Collection resultList=null, manCommentList=null, labCommentList=null, labCompCommentList=null;
              ArrayList result1List=null, prevCockpitDetail1List=null,filterList = null;
              OracleConnectionManager manager = null;
              boolean flag = false;
              try
                   labc2 = new LabCockpitDO();
                   prevCockpitDetail1List = (ArrayList) prevCockpitDetailList;
                   sqlQuery = new StringBuffer();
                   sqlQuery.append("select s.sample_sample_no sample_no, s.sample_inspection_lot_no inspection_lot_no,");
                   manager = new OracleConnectionManager();
                   conn = manager.getPooledConnection("myDS");
                   pstmt = conn.prepareStatement(sqlQuery.toString());
                   if(debug)
                   System.out.println("Query********"+sqlQuery.toString());
                   rs = pstmt.executeQuery();
              catch(Exception e)
                   //System.out.println(e);
                   throw e;
              finally
                        try
                             manager.releaseConnection("myDS");
    if(debug)
    System.out.println("Connection Status Closed=true/ Open=false=["+conn.isClosed()+"]");
    if(conn!=null || !conn.isClosed())
    conn.close();
    if(debug)
    System.out.println("Connection Status After Closing Connection Closed=true/ Open=false=["+conn.isClosed()+"]");
                             if(rs != null)
                                  rs.close();
                             if(pstmt != null)
                                  pstmt.close();
                             conn = null;
                             pstmt=null;
                             rs = null;
                             sqlQuery=null;
                             returnStr=null;
                             labc=null;
                             labc2=null;
                             manCommentList=null;
                             labCommentList=null;
                             labCompCommentList=null;
                             tempComment1=null;
                             tempComment2=null;
                             resultList=null;
                             prevCockpitDetailList=null;
                             prevCockpitDetail1List=null;
                        catch(Exception e)
                             //System.out.println("Unable to Release Connection ="+e);
                             throw e;
              //if(debug)     
              //System.out.println(resultList);
              return result1List;
         }

    Hi,
    As you can see from other posts, this is a very common problem. Until now the cause always ends up pointing to a connection not being close.
    I suggest you try to run through a full single cycle of you app, while using the CLI monitoting to check that the connections created/closed matches the expected created/closed connections. Also that the number of free connections at the end is correct.

  • Database Error: RSR0009: Resource not available for pool. Wait-time expired

    i am occassionally receiving the following error during database connections in my servlet:
    Database Error: RSR0009: Resource not available for pool [webAdvisorTestPool]. Wait-time expired
    i understand that this is a result of a connection leak from improper closure of my Connection object, but i thought that i was properly closing my connection.
    i can get the error if i do the following steps:
    1) access my login page and enter login credentials.
    2) submit the login which then hits the Authentication servlet.
    3) Authentication servlet authenticates and takes me to home page.
    4) hit the back button to get back to the login page.
    5) repeat this process until i hit the Max Pool Size (from web server).
    6) then i get the error message
    here are some details:
    i have an Authentication servlet; here is the pertinent code from that servlet:
    try {     // retrieve the user and add the User object to the session     DAO dao = new DAO();     Person authenticUser = dao.getPerson(userID, password);     session.setAttribute("validUser", authenticUser);     redirectPage = mapping.findForward("success"); }
    i also have a DAO object that handles all of my DB transactions (and you can see from my code above that the Authentication servlet is using that object); here is the pertinant code from that servlet:
    public DAO() {     datasource = "java:comp/env/jdbc/webAdvisorTest"; } public Person getPerson(String userID, String password)     throws ObjectNotFoundException {     // JDBC variables     DataSource ds = null;     Connection conn = null;     PreparedStatement stmt = null;     ResultSet results = null;     // User variables     Person validUser = null;     try     {         // Retrieve the DataSource from JNDI         InitialContext ctx = new InitialContext();         // if this statement fails, NamingException is thrown         ds = (DataSource)ctx.lookup(datasource);         // get DB connection and perform SQL operations         conn = ds.getConnection();         // User variables         String validUserID = null;         String validFName = null;         String validLName = null;         String validEmail = null;         // get DB connection and perform SQL operations         conn = ds.getConnection();         stmt = conn.prepareStatement(PERSON_QUERY);         stmt.setString(1, userID);         stmt.setString(2, password);         results = stmt.executeQuery();         // iterate through the results         if (results.next())         {             validUserID = results.getString("id");             validFName = results.getString("first_name");             validLName = results.getString("last_name");             validUser = new Person(validUserID, validFName, validLName);         }     }     // handle SQL errors     catch(SQLException e)     {         e.printStackTrace(System.err);         throw new RuntimeException("Database Error: " + e.getMessage());     }     // handle JNDI errors     catch(NamingException e)     {         throw new RuntimeException("JNDI Error: " + e.getMessage());     }     // clean up resources     finally     {         doClosure(results, stmt, conn);     }     // if the user was not found, throw ObjectNotFoundException     if(validUser == null)     {         throw new ObjectNotFoundException();     }     return validUser; } protected void doClosure(ResultSet results, PreparedStatement stmt,     Connection conn) {     if (results != null)     {         try { results.close(); }         catch (SQLException e) { e.printStackTrace(System.err); }     }     if (stmt != null)     {         try { stmt.close(); }         catch (SQLException e) { e.printStackTrace(System.err); }     }     if (conn != null)     {         try         {             System.out.println("R18Resources.conn before close: " + conn);             conn.close();             System.out.println("R18Resources.conn after close: " + conn);             System.out.println("R18Resources.conn is closed? " +                 conn.isClosed());         }         catch (SQLException e)         {             System.out.println("R18Resource conn close error: " +                 e.getMessage());         }     } }
    as you can see, i've added some print statements in my connection closure block. based on my output log, each connection is being properly closed and i am not encountering any errors during that closing block.
    any ideas???
    Message was edited by:
    millerand

    Please try the following code in your doClosure method. Replace your code with the following code.
    public void doClosure(ResultSet pResultSet, Statement pStmt, Connection pConn) throws Exception {
    try {
                   if (pResultSet != null) {
                        pResultSet.close();
                        pResultSet = null;
              } catch (SQLException se) {
              logger.error( se );
              } finally {
                   try {
                        if (pStmt != null) {
                             pStmt.close();
                             pStmt = null;
                   } catch (SQLException se) {
                   logger.error(se);
                   } finally {
                        try {
                             if (pConn != null) {
                                  pConn.close();
                                  pConn = null;
                        } catch (SQLException se) {
                        logger.error(se);
    And let me know if you still face this issue. What is the application server you are using?

  • Error : No available resource. Wait-time expired.

    Hi,
    We have a big problem of connection pooling in SunOne.
    After out program execute a lot of sql command in a short time, SunOne 7.0 throws an Exception ---- No available resource. Wait-time expired. We modify the connection pool setting, but it doesn't work. Can someone help to solve problem.
    Our connectiong pool setting as below :
    <jdbc-connection-pool steady-pool-size="8" max-pool-size="32" max-wait-time-in-millis="60000" pool-resize-quantity="2" idle-timeout-in-seconds="300" is-isolation-level-guaranteed="false" is-connection-validation-required="true" connection-validation-method="auto-commit" fail-all-connections="false" datasource-classname="oracle.jdbc.pool.OracleDataSource" name="xxx">
    <property value="jdbc:oracle:thin:@aa:1521:aa" name="URL"/>
    <property value="xxx" name="user"/>
    <property value="xxx" name="password"/>
    </jdbc-connection-pool>
    Thanks!
    Elsa

    This issue is not resolved. I got this message this afternoon. It has nothing to do with ejb. Just for confirming this issue again, I created a very simple application, a jsp that calls a servlet. In the servlet, I have a loop that calls a getNewConnection(). and returns the connection, then I create a Statement with that connection. Then I call another method releaseResources(Statement stmt)
    Connection conn = stmt.getConnection();
    if(conn != null)
    System.out.println("connection: " + conn);
    conn.close();
    // conn = null; tried this one also, same result
    The code is OK. including try/catch blocks ans so on.
    If the number of loops greater than the connection pool size, then I get the same exception. It means the connections are not getting closed. But if I change the methode and pass Connection instead of Statement, then it workes fine.
    I have tested this in App server7 with:
    Oracle 9.2.0 client and ojdbc14.jar
    Oracle 9.2.0 client and classes12.jar
    Oracle 9.0.1 client and classes12.jar
    Oracle 8.1.6 client and classes12.zip
    all with thin or oci drivers.
    It looks like something to do with Statement.getConnection() and the version of AppServer jdk (1.4.0.2).
    I know the getConnection methode does return A connection. I can print the connection id.

  • Java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMFAIL start() failed on resource 'myDomain': XAER_RMFAIL : Resource manager is unavailable

    Hi All,
    I am facing below issue without any change in the config from weblogic
    Managed servers are coming up and running without any issue
    But when we are doing any operation from application then its failing
    java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMFAIL start() failed on resource 'myDomain': XAER_RMFAIL : Resource manager is unavailable
    Regards
    Lokesh

    Hi,
    Can you please try increase the below MaxXACallMillis setting in Weblogic set 'Maximum Duration of XA Calls' to a bigger value
    MaxXACallMillis: Sets the maximum allowed duration (in milliseconds) of XA calls to XA resources. This setting applies to the entire domain.
    http://docs.oracle.com/cd/E12840_01/wls/docs103/jta/trxcon.html
    The parameter is exposed through administration console: services --> jta --> advanced --> "Maximum Duration of XA Calls:"
    Check the below docs for more information
    WLS 10.3: Intermittent XA error: XAResource.XAER_RMERR (Doc ID 1118264.1)
    Hope it Helps

  • No available resource. Wait-time expired.

    Dear All
    I am using sun ONE applications server. I am struggling with No available resource. Wait-time expired problem. MY Pool configurations are steady:20,max:100,inc:2. My code is very straight forward.
    Getting the connection, using the connection and closing the connection. I made sure that the connection opened is getting closed. But still after certain no. of requests my request is getting blocked. What might be the problem.
    Regards,
    Nagaraju.KV

    Hi,
    As you can see from other posts, this is a very common problem. Until now the cause always ends up pointing to a connection not being close.
    I suggest you try to run through a full single cycle of you app, while using the CLI monitoting to check that the connections created/closed matches the expected created/closed connections. Also that the number of free connections at the end is correct.

  • Java.sql.SQLException: XA error: XAER_PROTO : Routine was invoked in an inp

    we're using wls 8.1sp2 w/ oracle. our database connection setup works fine when using a JBDCConnectionPool, and specifying SupportsLocalTransactions="true", RollbackLocalxUponClose="true" (among many other settings).
              i'm looking into moving from using a JDBCConnectionPool/DataSource configured in the config.xml to using a DataSourceFactory along with using a <jdbc-connection-pool> in the weblogic-application.xml. the reason for this is to keep the data source from being publicly available. if someone else wants to get to our data, they're going to go through our beans, not a jdbc connection from the ds. please let me know if i'm mistaken that this will accomplish that goal.
              here's the settings setup for the xa-parms in the weblogic-application.xml:
              <xa-params>
              <debug-level>3</debug-level>
              <keep-conn-until-tx-complete-enabled>true</keep-conn-until-tx-complete-enabled>
              <local-transaction-supported>true</local-transaction-supported>
              <xa-transaction-timeout>30</xa-transaction-timeout>
              <rollback-localtx-upon-connclose>true</rollback-localtx-upon-connclose>
              </xa-params>
              that's the setup. now the problem. when using the weblogic-application.xml method, we see various errors with stack traces that look like:
              java.sql.SQLException: XA error: XAER_PROTO : Routine was invoked in an inproper context start() failed on resource 'weblogic.jdbc.jta.DataSource': XAER_PROTO : Routine was invoked in an inproper context
              javax.transaction.xa.XAException
                   at oracle.jdbc.xa.OracleXAResource.disallowLocalTxnMode(OracleXAResource.java:1048)
                   at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:153)
                   at weblogic.jdbc.jta.DataSource.start(DataSource.java:617)
                   at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1075)
                   at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1007)
                   at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:203)
                   at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
                   at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1287)
                   at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1250)
              this is with using the oracle.jdbc.xa.client.OracleXADataSource driver in the ojdbc14.jar supplied with our weblogic. they don't happen every time a bean uses a connection, and it seems to be fairly consistant where the stack traces occur (when a bean tries to get a connection from the ds).
              i grabbed the 10g version of odjbc14.jar from oracle (is there a way to tell specifically what version the ojdbc14.jar is from the jar itself?), and these errors went away. are driver upgrades like this supported by weblogic? i don't want to get into a situation where we have a critical issue and weblogic support tells me it's not a driver they issued. i'd really like to use this driver as to the 8.1.sp2 driver, as the 10g driver now supports clob/blob in a more vendor neutral way.
              if anyone has comments/suggestions on this it would be most appreciated.

    The driver itself is from oracle so any issues with the driver are supported by oracle not by BEA.
              I think you should be fine using the latest driver.
              sree

  • Java.sql.SQLException: Error in allocating a connection. Cause: No Password

    I'm deploying an EJB Module with a CMP in SJAS from SJSE.
    I get the following exception "java.sql.SQLException: Error in allocating a connection. Cause: No PasswordCredential found" the first time a CMP tries to connect to the MS SQL Server database.
    I can connect through the Admin console (PING works fine) but this error hapens in runtime.
    The datasource classname i'm using is "com.sun.sql.jdbcx.sqlserver.SQLServerDataSource" which is suggested by the SJSE.
    Any help will be welcome...
    Nelson Marques

    If you are using Netbeans, then this link might help:
    http://forum.java.sun.com/thread.jspa?forumID=136&threadID=598423
    Otherwise, have you try this ?
    Verify your sun-ejb-jar.xml does not use default-resource-princinpal element:
    <res-ref-name>jdbc/pdisasdb</res-ref-name>
    <jndi-name>jdbc/pdisasdb</jndi-name>
    <default-resource-principal>
    <name>myname</name>
    <password>geheim</password>
    </default-resource-principal>
    </resource-ref>

  • Caused by: java.sql.SQLException: ORA-00060: deadlock detected while waitin

    Hi,
    I'm getting following exception:
    Caused by: net.sf.hibernate.exception.GenericJDBCException: could not update: [com.sample.database.hibernate.mappings.reference.impl.TaskImpl#156979998]
         at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
         at net.sf.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:79)
         at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:30)
         at net.sf.hibernate.persister.AbstractEntityPersister.convert(AbstractEntityPersister.java:1332)
         at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:683)
         at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:623)
         at net.sf.hibernate.impl.ScheduledUpdate.execute(ScheduledUpdate.java:52)
         at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2438)
         at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2392)
         at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2260)
         at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
         at com.sample.database.hibernate.util.HibernateUtil.doSessionWork(HibernateUtil.java:83)
         ... 8 more
    Caused by: java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:158)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:623)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:181)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:685)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1138)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3018)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3090)
         at com.mchange.v2.sql.filter.FilterPreparedStatement.executeUpdate(FilterPreparedStatement.java:71)
         at net.sf.hibernate.persister.EntityPersister.update(EntityPersister.java:666)
         ... 15 more
    what could be the reason??
    thanks.

    The error is coming from an application. Please check the alert log file of the database and further there will be a trace file mentioned in the alert log file in which you will have information of the object which is causing deadlock.
    Regards

  • Java.sql.SQLException: ORA-00060: deadlock detected

    We are getting this error "java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource"
    Application tester is receiving this error what is problem/solution?

    Metalink Note:146580.1

  • JDBC Sender Adapter : java.sql.SQLException: Cursor state not valid.

    Hello all,
    We have configured JDBC Sender Adapter which fetches around 10K records with poll interval 1hr  from DB2 System .
    It was working fine,suddenly it started throwing an exception in Adapter Monitoring :
    Error during conversion of query result to XML: java.sql.SQLException: Cursor state not valid.
    It is not fetching any records.
    Without changing any configurations when we tried to fetch to around 1000 records it's working fine.
    For 10K records same exception persists
    What could be the reason ?How to resolve this issue?
    regards
    GangaPrasad

    Hello Christophe ,
    Trace in VA :::
    Date : 05/09/2008
    Time : 11:45:57:750
    Message : Unexpected error converting database resultset to XML, reason: java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Severity : Error
    Category : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    Location : com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(ResultSet, ResultSetMetaData)
    Application :
    Thread : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
    Datasource : 12428950:/usr/sap/PXI/DVEBMGS01/j2ee/cluster/server0/log/applications/com.sap.xi/xi.log
    Message ID : 00145E742794005E0014980B000000BE00044CC763766C4F
    Source Name : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    Argument Objs : java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Arguments : java.sql.SQLException: Cursor state not valid.
         at java.lang.Throwable.<init>(Throwable.java:194)
         at java.lang.Exception.<init>(Exception.java:41)
         at java.sql.SQLException.<init>(SQLException.java:40)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:389)
         at com.ibm.as400.access.JDError.throwSQLException(JDError.java:366)
         at com.ibm.as400.access.AS400JDBCResultSet.getValue(AS400JDBCResultSet.java:3580)
         at com.ibm.as400.access.AS400JDBCResultSet.getString(AS400JDBCResultSet.java:3223)
         at sun.reflect.GeneratedMethodAccessor459222074.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:309)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.TraceInvocationHandler.invoke(TraceInvocationHandler.java:45)
         at com.sap.aii.adapter.jdbc.sql.jdbctrace.$Proxy254.getString(Unknown Source)
         at com.sap.aii.adapter.jdbc.JDBC2XI.convert2XML(JDBC2XI.java:954)
         at com.sap.aii.adapter.jdbc.JDBC2XI.invoke(JDBC2XI.java:492)
         at com.sap.aii.af.service.scheduler.JobBroker$Worker.run(JobBroker.java:475)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:99)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:119)
    Dsr Component :
    Dsr Transaction : d1f629d01d9b11dd984200145e742794
    Dsr User :
    Indent : 0
    Level : 0
    Message Code :
    Message Type : 1
    Relatives : com.sap.aii.adapter.jdbc.JDBC2XI
    Resource Bundlename :
    Session : 0
    Source : /Applications/ExchangeInfrastructure/AdapterFramework/Services/ADAPTER/ADMIN/JDBC
    ThreadObject : XI JDBC2XI[JDBC_SND_DB2_VehicleReceiving/DB2PRD00/]_170
    Transaction : SAP J2EE Engine JTA Transaction : [0ffffffbdffffffa6ffffff960086]
    User : J2EE_GUEST
    Regards
    Ganga Prasad

  • Java.sql.SQLException: Cannot load JDBC driver

    THis topic has been discussed many many times but I still not able to connect to Oracle 8i from my servlet using Tomcat 4.1.12 on hp-ux and java1.3
    I always got: java.sql.SQLException: Cannot load JDBC driver class 'null'
    In server.xml:
    <Context Path="/MyApp" docBase="MyApp" debug="0" reloadable="true" >
    <Resource name="jdbc/ora" auth="Container" type="javax.sql.DataSource"/> <ResourceParams name="jdbc/ora" >
    <parameter>
    <name>username</name>
    <value>myname</value>
    </parameter>
    <parameter> <name>password</name>
    <value>mypassword</value>
    </parameter>
    <parameter> <name>driverClassName</name>
    <value>oracle.jdbc.driver.OracleDriver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:oracle:thin:@myhostname:1521:ora</value>
    </parameter> </ResourceParams>
    </Context>
    In MyApp/WEB-INF/web.xml:
    <resource-ref>
    <res-ref-name>jdbc/ora</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    The Oracle jdbc jar file classes12.jar is under common/lib in Tomcat's home. read Permission is there.
    In the servlet:
    init(ServletConfig config):
    Context init = new InitialContext();
    Context ctx = (Context) init.lookup("java:comp/env");
    dataSource = (DataSource) ctx.lookup("jdbc/acdb");
    doPost(..)
    the error occured at :
    synchronized (dataSource){
    con = dataSource.getConnection();}
    Thanks in advance!

    Everything looks correct to me, except for one thing.
    In your web.xml you have this:
    <res-ref-name>jdbc/ora</res-ref-name> In your server.xml, you have this tag, which matches your web.xml:
    <ResourceParams name="jdbc/ora" > But in your Java code, you've got this:
    dataSource = (DataSource) ctx.lookup("jdbc/acdb"); When I've successfully set up a Web app data source, all three names had to agree. You either need to change your Java lookup name to "jdbc/ora" or change the web.xml and server.xml to "jdbc/acdb".
    See if that does it. Everything else sounds correct to me. - MOD

  • Java.sql.SQLException: ORA-01157: cannot identify/lock data file : PLz Help

    My datafiles are in ASM file system, however the only one file ACIPEN_DATA is the one, which is not in ASM file system, and this the file which is in concern.
    We are getting the following exception in the lxkratgas1.lex1.lexmark.com when connecting to ACIPEN_DATA.
    This exception is coming up sometimes and the sometimes the file is getting processed successfully
    Caused by: java.sql.SQLException: ORA-01157: cannot identify/lock data file 9 - see DBWR trace file
    ORA-01110: data file 9: '/oracle/SE/product/10.2.0/db_1/dbs/ACIPEN_DATA'
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
    at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
    at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3368)
    at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:278)
    at atg.adapter.gsa.SQLStatement.executeUpdate(SQLStatement.java:725)
    at atg.adapter.gsa.Table.insert(Table.java:1378)
    at atg.adapter.gsa.GSAItemDescriptor.addItem(GSAItemDescriptor.java:6272)
    ... 61 more
    ====================================================================
    We have checked the datafile, it is absolutely online.
    Can some expert jump in and resolve this issue Please.

    01157, 00000, "cannot identify/lock data file %s - see DBWR trace file"
    // *Cause:  The background process was either unable to find one of the data
    //         files or failed to lock it because the file was already in use.
    //         The database will prohibit access to this file but other files will
    //         be unaffected. However the first instance to open the database will
    //         need to access all online data files. Accompanying error from the
    //         operating system describes why the file could not be identified.
    // *Action: Have operating system make file available to database. Then either
    //         open the database or do ALTER SYSTEM CHECK DATAFILES.is this a RAC database?

  • DBAdapter for SQL Server Caused by java.sql.SQLException: [FMWGEN][SQLServe

    Have Oracle SOA 11.1.1.5 composite that does insert/update on SQL Server table. Using DBAdapter to connect to SQL Server for this insert/update. Number of instances is huge so every now and then getting the below error. Have another composite that does that same but in Oracle Table but never run into the below issues it's only with SQL Server database giving the below errors very often. Any idea on how to resolve this issue what could be the cause
    don't know why it throws this error *Descriptor name: [UpdateSQLServer.TableName]. Caused by java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver]Object has been closed..* is there any issue with DBAdapter for SQL Server or is it a load issue as I don't see this with oracle tables
    CompositeNameService 16415534 remoteFault com.oracle.bpel.client.BPELFault:
    faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault}
    messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
    parts: {{ summary=Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'update' failed due to: DBWriteInteractionSpec Execute Failed Exception. update failed.
    Descriptor name: [UpdateSQLServer.TableName]. Caused by java.sql.SQLException: [FMWGEN][SQLServer JDBC Driver]Object has been closed..
    Please see the logs for the full DBAdapter logging output prior to this exception.
    This exception is considered retriable, likely due to a communication failure. To classify it as non-retriable instead add property nonRetriableErrorCodes with value "0" to your
    deployment descriptor (i.e. weblogic-ra.xml). To auto retry a retriable fault set these composite.xml properties for this invoke: jca.retry.interval, jca.retry.count, and
    jca.retry.backoff. All properties are integers. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. ,
    detail=[FMWGEN][SQLServer JDBC Driver]Object has been closed. ,code=0} Any help is appreciated.
    Thanks

    Hi,
    Currently "Test Connections On Reserve" is unchecked but wondering what benefit will it give if I make it selected anyways if it fails still the Process will error out or does it holds the process till the connection is available and then continues. Will there be a performance hit. As currently the volume is very high and if selecting the above then for each instance it will check first if connection is available and does it affect on the performance or anything else
    Also "Connection Reserve Timeout:" is set to 10 seconds.
    Thanks

  • Web Service Error: java.sql.SQLException: Io exception: Broken pipe

    Hi,
    I am using JDeveloper PL/SQL web service generator. After some time we start receiving the "java.sql.SQLException: Io exception: Broken pipe" exception when we invoke the web service. I've noticed that the error starts occuring once all the connections in the database have been closed.
    Here are the Data Source configurations I tried using:
    <data-source name="jdev-connection-SACS" class="com.evermind.sql.DriverManagerDataSource" location="jdbc/SACSCoreDS" xa-location="jdbc/xa/SACSXADS" ejb-location="jdbc/SACSDS" pooled-location="jdbc/MACSPooledDS" connection-driver="oracle.jdbc.driver.OracleDriver" username="xxx" password="xxxx" url="jdbc:oracle:thin:@test:1521:SACS" inactivity-timeout="30" connection-retry-interval="3" max-connections="5" min-connections="0" wait-timeout="20"/>
    AND I also tried:
    <data-source name="jdev-connection-SACS" class="com.evermind.sql.DriverManagerDataSource" location="jdbc/SACSCoreDS" xa-location="jdbc/xa/SACSXADS" ejb-location="jdbc/SACSDS" pooled-location="jdbc/SACSPooledDS" connection-driver="oracle.jdbc.driver.OracleDriver" username="xxxx" password="xxxx" url="jdbc:oracle:thin:@xxxx:1521:SACS" inactivity-timeout="30"/>
    That did not make any changes.
    I then changed ConnectionContext.KEEP_CONNECTION to ConnectionContext.CLOSE_CONNECTION in the <name>Base.sqlj:
    public void release() throws SQLException
    { if (__tx!=null && __onn!=null) __tx.close(ConnectionContext.CLOSE_CONNECTION);
    __onn = null; __tx = null;
    That did not help either. We are running these web services on the standalone OC4J and Oracle 8.1.7.2 database with the MTS installed on it.

    Hi,
    I don't use JDeveloper to develop stored procedure web services. However, I do use WebServicesAssembler.jar to generate stored procedure web services.
    I had the same problem as you did. After some research in this forum, I was informed that it's a bug in the web services generator itself. I was also informed that the newest version of WebServicesAssembler.jar is supposed to fix the problem.
    If you want, you can always write a batch job to restart the OC4J periodically. The command is
    dcmctl -ct oc4j -co home
    If I come across the posting containing the answer to your solution, I will forward it to you.
    Good luck
    Jack

Maybe you are looking for