Closing connection

Hello, I work with jdeveloper. I had 10.1.2 which used java version 1.4.2 and I used a simple connection class to call stored procedures in an Oracle db. I have jdeveloper 10.1.3 which uses java version 1.5.0 and the same class fails when I try to use ResultSets. I use to close the connection then return the resultset to whatever called it, now it tells me the connection is already closed when I try to access the resultset. I know this is why it's failing now, because it works if I don't close anything.
Can someone tell me how/why this has changed, and what I can do about it?
Thanks
Classes that use to work:
public class dbConn {
public dbConn() {
public static Connection getCon()
InitialContext ctx = null;
DataSource ds = null;
Connection conn = null;
try {
ctx = new InitialContext();
ds = (DataSource) ctx.lookup("jdbc/app1");
conn = ds.getConnection();
catch(Exception e){
System.out.println("Connection Error");
e.printStackTrace();
return conn;
public static void closeCon(CallableStatement proc, Connection conn)
try {
proc.close();
conn.close();
catch(SQLException e){
System.out.println("Error closing connections: "+e);
public static void main()
public static ResultSet GenResSet(String uname, String procName)
Connection conn = null;
CallableStatement proc = null;
ResultSet rs = null;
String callString = "{ call "+procName+"(?,?) }";
try {
conn = dbConn.getCon();
proc = conn.prepareCall(callString);
proc.registerOutParameter(1,OracleTypes.CURSOR);
proc.setString(2, uname);
proc.execute();
rs = (ResultSet)proc.getObject(1);
catch(SQLException e) {
System.out.println("sql error");
e.printStackTrace();
finally {
dbConn.closeCon(proc,conn);
return rs;
}

Ok thanks. So I can learn.. what exactly is my
misconception about how it works? My beginner view is
you stored a cursor set from a database query in a
result set then you could iterate through it. Why
does it have to be stored in a collection first? I
was closing the connection before I returned it, or
so I thought. It went through the finally code to
close everytime, but I could still use the results.
Maybe it wasn't closing them?That's exactly your misconception. After you close the connection, your ResultSet is not valid. In simple words, you need a live connection to fetch values from the ResultSet. In your method, you close the connection in the finally block and return the resultset. You will need to hold the results in something else, which would be some suitable collection.

Similar Messages

  • Just closing connection enough?

    Hi friends..This is my first post...I am a newbie Java Developer..Okay Here goes
    I have just made a LAN based Java application using Swing,JDBC with backend as MS-Access..The backend is on a shared network drive..
    The application is distributed as jar files on the LAN PCs..
    Everywhere I have connected to the database I have just closed the connection explicitly like this
    con.close();
    I do not close the associated resultset and statement explicitly
    The specification says associated statements and resultsets close when you close
    the connection,even if you don't explicitly close them
    Also I am not using connection pool..its simple basic connection using DriverManager
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbcdbcSN name";
    String user = "";
    String pw = "";
    con = DriverManager.getConnection(url, user, pw);
    Statement stmt = con.createStatement();
    String select = "" ;
    ResultSet rows = stmt.executeQuery(select);
    Till now no performance problems..over 4K records have been added..
    JVM is not exiting or anything..
    On the net everyone says to explicitly close everything..but I did not know that
    earlier..
    My question is
    Is closing just the connection enough..?
    Is there any way I can check whether statements and resultsets have been implicitly closed?
    Later on will it cause any performance problems or anything...?
    Shud I change my code and add rs.close() and stmt.close() everywhere..?
    If specification says everything closes on
    closing connection why do ppl insist on closing everything explicitly..?
    Or is this driver dependent..don't the drivers go through the specification..
    My driver is the Sun JDBC ODBC bridge.....
    There would be 8-10 users maximum at a time using the application concurrently...
    Any help would be appreciated..Thanks in advance..

    @jschell
    Thanks for your help
    I was running a few more tests..can you please explain the the following code...
    Code
    import java.sql.*;
    import java.io.*;
    class gc5test
    public static void main(String args[])
    Connection con = null;
    long memoryBeforeSelects;
    long memoryAfterSelects;
    long memoryAfterConnectionClose;
    try
    PrintWriter pw= new PrintWriter("c:\\log1.txt");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url = "jdbc:odbc:pravahcon";
    String user = "admin";
    String pass = "ash123";
    for(int i=1;i<=20;i++)
    pw.println("Connection No"+i);
    memoryBeforeSelects = Runtime.getRuntime().freeMemory();
    pw.println("Free Memory before making connection " + memoryBeforeSelects / 1024 + " kB");
    con = DriverManager.getConnection(url, user, pass);
    Statement stmt = con.createStatement();
    String select = "SELECT * FROM Users" ;
    ResultSet rows = stmt.executeQuery(select);
    memoryAfterSelects = Runtime.getRuntime().freeMemory();
    pw.println("Free Memory after making connection " + memoryAfterSelects / 1024 + " kB");
    rows.close();
    stmt.close();
    con.close();
    memoryAfterConnectionClose = Runtime.getRuntime().freeMemory();
    pw.println("Free Memory after closing connection " + memoryAfterConnectionClose / 1024 + " kB");
    pw.close();
    catch (ClassNotFoundException f)
    System.out.println(f.getMessage());
    System.exit(0);
    catch (SQLException g)
    System.out.println(g.getMessage());
    System.exit(0);
    catch (Exception e)
    System.out.println(e.getMessage());
    System.exit(0);
    Output
    Connection No1
    Free Memory before making connection 4729 kB
    Free Memory after making connection 4675 kB
    Free Memory after closing connection 4675 kB
    Connection No2
    Free Memory before making connection 4675 kB
    Free Memory after making connection 4638 kB
    Free Memory after closing connection 4620 kB
    Connection No3
    Free Memory before making connection 4620 kB
    Free Memory after making connection 4584 kB
    Free Memory after closing connection 4584 kB
    Connection No4
    Free Memory before making connection 4584 kB
    Free Memory after making connection 4548 kB
    Free Memory after closing connection 4529 kB
    Connection No5
    Free Memory before making connection 4529 kB
    Free Memory after making connection 4493 kB
    Free Memory after closing connection 4493 kB
    Connection No6
    Free Memory before making connection 4493 kB
    Free Memory after making connection 4457 kB
    Free Memory after closing connection 4457 kB
    Connection No7
    Free Memory before making connection 4439 kB
    Free Memory after making connection 4403 kB
    Free Memory after closing connection 4403 kB
    Connection No8
    Free Memory before making connection 4403 kB
    Free Memory after making connection 4367 kB
    Free Memory after closing connection 4367 kB
    Connection No9
    Free Memory before making connection 4349 kB
    Free Memory after making connection 4313 kB
    Free Memory after closing connection 4313 kB
    Connection No10
    Free Memory before making connection 4313 kB
    Free Memory after making connection 4277 kB
    Free Memory after closing connection 4277 kB
    Connection No11
    Free Memory before making connection 4259 kB
    Free Memory after making connection 4223 kB
    Free Memory after closing connection 4223 kB
    Connection No12
    Free Memory before making connection 4223 kB
    Free Memory after making connection 4187 kB
    Free Memory after closing connection 4169 kB
    Connection No13
    Free Memory before making connection 4169 kB
    Free Memory after making connection 4817 kB
    Free Memory after closing connection 4800 kB
    Connection No14
    Free Memory before making connection 4800 kB
    Free Memory after making connection 4766 kB
    Free Memory after closing connection 4766 kB
    Connection No15
    Free Memory before making connection 4766 kB
    Free Memory after making connection 4714 kB
    Free Memory after closing connection 4714 kB
    Connection No16
    Free Memory before making connection 4714 kB
    Free Memory after making connection 4678 kB
    Free Memory after closing connection 4678 kB
    Connection No17
    Free Memory before making connection 4678 kB
    Free Memory after making connection 4627 kB
    Free Memory after closing connection 4627 kB
    Connection No18
    Free Memory before making connection 4627 kB
    Free Memory after making connection 4592 kB
    Free Memory after closing connection 4575 kB
    Connection No19
    Free Memory before making connection 4575 kB
    Free Memory after making connection 4540 kB
    Free Memory after closing connection 4540 kB
    Connection No20
    Free Memory before making connection 4540 kB
    Free Memory after making connection 4489 kB
    Free Memory after closing connection 4489 kB
    The memory is not being freed immediately after closing connection explicitly in first 12 iterations..
    In the first 12 iterations memory after making connection and memory after closing
    connection are the same/or very less difference...
    Only in the 13th iteration the memory increases from 4169 to 4817..
    Why is this happening..?
    I am closing everything explicitly..
    Shouldn't the memory be reclaimed immediately..?
    Insted it is happening later on..
    Am I missing something here..?

  • Closing connections question

    Hi, My application seems to be running out of memory despite closing the resultsets and connections used.
    I have a DBHelper class (DBHelper.java) with the following 2 methods:
    public Connection getConn(){
    // setups a JDBC connection and returns it
    // Close all connections
    public void cleanUp(){          
    try{
    if(this.conn != null && !this.conn.isClosed()){
    this.production_Conn.close();
    catch(SQLException e){
    System.out.println(e.getMessage());
    So let's say if I have another class, e.g. Class A, that creates a Connection object using DBHelper.getConn() method, will calling DBHelper.cleanUp() be sufficient to close the connection? Or do i have to clear the reference object used inside Class A as well?
    Regards

    First off, are you sure you're out of memory is related to not closing connections? Mostly connections and ResultSets don't use that much memory so you usually run into database problems (too many open connections, too many sessions, etc.) before the Java app runs out of memory. Is it possible the leak is elsewhere?
    If you're sure its connection related maybe a problem with the helper class? Does getConn() create a new connection every time its called? If so, it looks like cleanUp() only closes the most recently opened connection - but without seeing the whole class I can't be sure.
    For example, the following would leave an open connection - though if the app is no longer referencing it, it should get garbage collected and closed eventually (though relying on this is bad form).
    class Bad {
       Connection con;
       public Connection getConn()
             con = // create connection
             return con;
       public void cleanUp()
             con.close();
       public static void main( String[] args )
             Bad b = new Bad();
             b.getConn();
             b.getConn();
             b.cleanUp();
    }- Jemiah

  • SQLException: Closed Connection, SQL state [null]; error code [17002]

    Hello All,
    I am supporting a Java 5 project on Tomcat. We've used Spring and Stored Procedure in the project.
    Recently we deployed our application in a GoLive environment and have started seeing Timeout errors in log files. After around two days we also have to restart Tomcat as users are no more able to login to access the application.
    Same application runs fine without any timeout issues on another environment.
    The only difference between two environments is that the Go-Live env has a firewall between Tomcat and Database and the other environment hosts both Tomcat and Database on same machine (i.e. no firewall).
    For GoLive env the only port open on firewall for JDBC connection is 1521 and is used in the connection string url for obtaining the connections.
    When there is a Timeout error, the N/w admin guy observed that the JDBC connection was not attempted on 1521 port, but on some random port which is not open on firewall, due to which the Database server logs also do not show entry for this connection attempt as it gets blocked by the firewall.
    I am not sure why a randam port should be used to connect when a specific port is mentioned in the connection url? Also what can be making this port switching?
    Application uses Apache DBCP with Spring to obtain connections.
    Has anyone experienced similar errors?
    Any suggestions/help on this issue is greatly appreciated!
    Many Thanks,
    CD
    ===============================
    Error Log Extract:
    Error while extracting database product name - falling back to empty error codes
    org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: Closed Connection
    java.sql.SQLException: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.PhysicalConnection.getMetaData(PhysicalConnection.java:1605)
    at org.apache.commons.dbcp.DelegatingConnection.getMetaData(DelegatingConnection.java:247)
    at org.apache.commons.dbcp.DelegatingConnection.getMetaData(DelegatingConnection.java:247)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.getMetaData(PoolingDataSource.java:231)
    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:172)
    at org.springframework.jdbc.support.JdbcUtils.extractDatabaseMetaData(JdbcUtils.java:207)
    at org.springframework.jdbc.support.SQLErrorCodesFactory.getErrorCodes(SQLErrorCodesFactory.java:187)
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.setDataSource(SQLErrorCodeSQLExceptionTranslator.java:126)
    at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.<init>(SQLErrorCodeSQLExceptionTranslator.java:92)
    at org.springframework.jdbc.support.JdbcAccessor.getExceptionTranslator(JdbcAccessor.java:96)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:294)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:356)
    at com.o2.morse.dao.impl.sql.UserDaoImpl.batchLoad(UserDaoImpl.java:371)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Could not close JDBC Connection
    java.sql.SQLException: Already closed.
    at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:77)
    at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:180)
    at org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:286)
    at org.springframework.jdbc.datasource.DataSourceUtils.releaseConnection(DataSourceUtils.java:247)
    at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCleanupAfterCompletion(DataSourceTransactionManager.java:297)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:754)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:615)
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:284)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Application exception overridden by rollback exception
    org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [SELECT ID_USER_DETAILS, USERNAME, CREATED_ON, LAST_LOGIN FROM USER_DETAILS  WHERE STATUS = 157 AND SUPERUSER <> 'Y']; SQL state [null]; error code [17002] ; Io exception: Connection timed out; nested exception is java.sql.SQLException: Io exception: Connection timed out
    java.sql.SQLException: Io exception: Connection timed out
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
    at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:820)
    at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1049)
    at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:845)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1154)
    at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1313)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
    at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
    at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:333)
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:282)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
    at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:356)
    at com.o2.morse.dao.impl.sql.UserDaoImpl.batchLoad(UserDaoImpl.java:371)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:287)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
    at $Proxy3.batchLoad(Unknown Source)
    at com.o2.morse.domain.User.doHousekeeping(User.java:667)
    at com.o2.morse.domain.User$$FastClassByCGLIB$$372ff70b.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.domain.User$$EnhancerByCGLIB$$d5ac966a.doHousekeeping(<generated>)
    at com.o2.morse.scheduler.EndOfDay.run(EndOfDay.java:63)
    at com.o2.morse.scheduler.EndOfDay$$FastClassByCGLIB$$3b2d4927.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:705)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
    at com.o2.morse.scheduler.EndOfDay$$EnhancerByCGLIB$$488a9f86.run(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:248)
    at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:165)
    at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:90)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
    Batch Job Failed: org.springframework.transaction.TransactionSystemException: Could not roll back JDBC transaction; nested exception is java.sql.SQLException: Closed Connection

    I am using latest Jrockit 16)5, ojdbc6_g.jar,spring.jar Weblogic 10.3 and Oracle 10G 10.2.4 .. whatever but always get "Closed Connection"
    java.lang.Throwable: Closed Connection
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
    at oracle.jdbc.driver.PhysicalConnection.createStatement(PhysicalConnection.java:750)
    at oracle.jdbc.OracleConnectionWrapper.createStatement(OracleConnectionWrapper.java:183)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

  • Java.sql.SQLException: can't create statement from closed connection

    java.sql.SQLException: can't create statement from closed connection.
    at com.caucho.sql.QPooledConnectionImpl.prepareStatement(QPooledConnecti onImpl.java:411)
    I am getting this error with my JSP's, i am running on Resin on Win2k, and MySql as backend.
    Has anyone else also faced this issue ?
    Looking for someone to help me to solve this issue.
    rc

    Looking for someone to help me to solve this issue.Maybe you are closing the connections. You might want to verify that you are not doing that. Or if you are that that is the correct way to return the connection to the pool.
    Or you could have stale connections. Some databases will time out connections if the connection is no used in a while. (This is a good thing.) But this means connection pools must do something with connections that are not used for a while. The pools usually have a configuration option(s) which allows you to set up a keep alive message which keeps the database from closing the connection.

  • CF 6.1 - JRUN Closed Connection/Server errors occurring on a daily basis

    We seem to be having issues with Jrun Closed Connection/Server errors occuring on a daily basis now. The server will stop responding to requests until the ColdFusion service is restarted.
    We're using CF 6.1, the following error message is from the log files and seems to be Java/JVM related but I was hesitant to make any changes to the JVM parameters.
    Any suggestions on how to resolve this daily issue of restarting CF service? Other than upgrading to more recent version of CF which we'll be doing later this year.
    Thanks,
    Dave
    >>>>>>>>>>>>
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x77FCAFF8
    Function=[Unknown.]
    Library=C:\WINNT\system32\ntdll.dll
    NOTE: We are unable to locate the function name symbol for the error
          just occurred. Please refer to release documentation for possible
          reason and solutions.
    Current Java thread:
              at java.io.WinNTFileSystem.list(Native Method)
              at java.io.File.list(File.java:915)
              at coldfusion.mail.MailSpooler.refreshSpoolFiles(MailSpooler.java:1484)
              at coldfusion.mail.MailSpooler.run(MailSpooler.java:897)
              at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:201)
              at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:70)
    Dynamic libraries:
    0x00400000 - 0x0040F000           C:\CFusionMX\runtime\bin\jrun.exe
    0x77F80000 - 0x77FFC000           C:\WINNT\system32\ntdll.dll
    0x7C570000 - 0x7C624000           C:\WINNT\system32\KERNEL32.dll
    0x7C2D0000 - 0x7C335000           C:\WINNT\system32\ADVAPI32.dll
    0x77D30000 - 0x77D9F000           C:\WINNT\system32\RPCRT4.dll
    0x78000000 - 0x78045000           C:\WINNT\system32\MSVCRT.dll
    0x08000000 - 0x082A7000           C:\CFusionMX\runtime\jre\bin\server\jvm.dll
    0x77E10000 - 0x77E6F000           C:\WINNT\system32\USER32.dll
    0x77F40000 - 0x77F7D000           C:\WINNT\system32\GDI32.dll
    0x77570000 - 0x775A0000           C:\WINNT\system32\WINMM.dll
    0x10000000 - 0x10007000           C:\CFusionMX\runtime\jre\bin\hpi.dll
    0x00770000 - 0x0077E000           C:\CFusionMX\runtime\jre\bin\verify.dll
    0x00780000 - 0x00798000           C:\CFusionMX\runtime\jre\bin\java.dll
    0x007A0000 - 0x007AD000           C:\CFusionMX\runtime\jre\bin\zip.dll
    0x39A70000 - 0x39A7F000           C:\CFusionMX\runtime\jre\bin\net.dll
    0x75030000 - 0x75044000           C:\WINNT\system32\WS2_32.dll
    0x75020000 - 0x75028000           C:\WINNT\system32\WS2HELP.DLL
    0x782C0000 - 0x782CC000           C:\WINNT\System32\rnr20.dll
    0x77980000 - 0x779A5000           C:\WINNT\system32\DNSAPI.DLL
    0x75050000 - 0x75058000           C:\WINNT\system32\WSOCK32.dll
    0x77340000 - 0x77353000           C:\WINNT\system32\iphlpapi.dll
    0x77520000 - 0x77525000           C:\WINNT\system32\ICMP.dll
    0x77320000 - 0x77337000           C:\WINNT\system32\MPRAPI.dll
    0x75150000 - 0x75160000           C:\WINNT\system32\SAMLIB.DLL
    0x7CDC0000 - 0x7CE10000           C:\WINNT\system32\NETAPI32.DLL
    0x7C340000 - 0x7C34E000           C:\WINNT\system32\Secur32.dll
    0x77BF0000 - 0x77C01000           C:\WINNT\system32\NTDSAPI.dll
    0x77950000 - 0x7797B000           C:\WINNT\system32\WLDAP32.DLL
    0x751C0000 - 0x751C6000           C:\WINNT\system32\NETRAP.dll
    0x7CE20000 - 0x7CF0F000           C:\WINNT\system32\OLE32.DLL
    0x779B0000 - 0x77A4C000           C:\WINNT\system32\OLEAUT32.DLL
    0x773B0000 - 0x773DF000           C:\WINNT\system32\ACTIVEDS.DLL
    0x77380000 - 0x773A3000           C:\WINNT\system32\ADSLDPC.DLL
    0x77830000 - 0x7783E000           C:\WINNT\system32\RTUTILS.DLL
    0x77880000 - 0x7790E000           C:\WINNT\system32\SETUPAPI.DLL
    0x7C0F0000 - 0x7C154000           C:\WINNT\system32\USERENV.DLL
    0x774E0000 - 0x77514000           C:\WINNT\system32\RASAPI32.dll
    0x774C0000 - 0x774D1000           C:\WINNT\system32\rasman.dll
    0x77530000 - 0x77552000           C:\WINNT\system32\TAPI32.dll
    0x71710000 - 0x71794000           C:\WINNT\system32\COMCTL32.DLL
    0x70A70000 - 0x70AD6000           C:\WINNT\system32\SHLWAPI.DLL
    0x77360000 - 0x77379000           C:\WINNT\system32\DHCPCSVC.DLL
    0x777E0000 - 0x777E8000           C:\WINNT\System32\winrnr.dll
    0x777F0000 - 0x777F5000           C:\WINNT\system32\rasadhlp.dll
    0x39FB0000 - 0x39FBC000           C:\CFusionMX\runtime\bin\portscan.dll
    0x74FD0000 - 0x74FED000           C:\WINNT\system32\msafd.dll
    0x75010000 - 0x75017000           C:\WINNT\System32\wshtcpip.dll
    0x3AAC0000 - 0x3AAC5000           C:\CFusionMX\runtime\jre\bin\rmi.dll
    0x3B9D0000 - 0x3B9D6000           C:\CFusionMX\runtime\jre\bin\ioser12.dll
    0x3BBE0000 - 0x3BC60000           C:\CFusionMX\lib\izmjniado.dll
    0x3C270000 - 0x3C278000           C:\CFusionMX\lib\CFXNeo.dll
    0x780A0000 - 0x780B2000           C:\WINNT\system32\MSVCIRT.dll
    0x780C0000 - 0x78121000           C:\WINNT\system32\MSVCP60.dll
    0x3C280000 - 0x3C28B000           C:\CFusionMX\lib\cfregistry.dll
    0x3C3A0000 - 0x3C3A8000           C:\CFusionMX\lib\PerfmonClient.dll
    0x3C5C0000 - 0x3C5CC000           C:\CFusionMX\lib\cfindex.dll
    0x3C5D0000 - 0x3C7C2000           C:\CFusionMX\lib\vdk200.dll
    0x3C7D0000 - 0x3C805000           C:\CFusionMX\lib\LIBALLRSEI.dll
    0x7CA00000 - 0x7CA23000           C:\WINNT\system32\rsaenh.dll
    0x7C740000 - 0x7C7CC000           C:\WINNT\system32\CRYPT32.dll
    0x77430000 - 0x77441000           C:\WINNT\system32\MSASN1.dll
    0x3EE10000 - 0x3EE3E000           C:\CFusion\CustomTags\GetUserGroups.dll
    0x77800000 - 0x7781E000           C:\WINNT\system32\WINSPOOL.DRV
    0x76620000 - 0x76631000           C:\WINNT\system32\MPR.DLL
    0x7CF30000 - 0x7D176000           C:\WINNT\system32\SHELL32.dll
    0x3F650000 - 0x3F75A000           C:\CFusionMX\runtime\jre\bin\awt.dll
    0x75E60000 - 0x75E7A000           C:\WINNT\system32\IMM32.dll
    0x3F760000 - 0x3F7B0000           C:\CFusionMX\runtime\jre\bin\fontmanager.dll
    0x72800000 - 0x72846000           C:\WINNT\system32\ddraw.dll
    0x728A0000 - 0x728A6000           C:\WINNT\system32\DCIMAN32.dll
    0x72CF0000 - 0x72D84000           C:\WINNT\system32\D3DIM700.DLL
    0x690A0000 - 0x690AB000           C:\WINNT\system32\PSAPI.DLL
    Heap at VM Abort:
    Heap
    PSYoungGen      total 5824K, used 1523K [0x10010000, 0x10800000, 0x138f0000)
      eden space 3520K, 26% used [0x10010000,0x100fa4e0,0x10380000)
      from space 2304K, 25% used [0x105c0000,0x106528b0,0x10800000)
      to   space 2304K, 0% used [0x10380000,0x10380000,0x105c0000)
    PSOldGen        total 29824K, used 22612K [0x138f0000, 0x15610000, 0x30010000)
      object space 29824K, 75% used [0x138f0000,0x14f051e0,0x15610000)
    PSPermGen       total 20736K, used 20580K [0x30010000, 0x31450000, 0x38010000)
      object space 20736K, 99% used [0x30010000,0x314293b0,0x31450000)
    Local Time = Fri Dec 13 13:50:53 2013
    Elapsed Time = 19424
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Server VM (1.4.2-b28 mixed mode)
    space 3520K, 26% used space 2304K, 25% used space 2304K, 0% used space 29824K, 75% used space 20736K, 99% used# An error report file has been saved as hs_err_pid2920.log.
    # Please refer to the file for further information.

    CF6, Java 1.4.2 and Windows NT - have not seen those for a long time myself.
    Perhaps this is the issue from error report:
    PSPermGen       total 20736K, used 20580K
    object space 20736K, 99% used
    I guess Java non heap space Permanent Generation is full the next object trying to load into that space can’t fit, plus all the objects in there are referenced so no objects can be removed so free space can’t be made available. One would need to do some work with Java logging and know what JVM.CONFIG looks like to know if that guess is accurate.
    You could try increase that parameter 10Mb or so and see what happens? In JVM.CONFIG, JVM args, -XX:MaxPermSize=NNm where NN = numbers.
    Needless to say you are running a lot of end of life product and should plan to migrate to something more current.
    HTH, Carl.

  • Oracle error: java.sql.sqlrecoverableException: Closed Connection

    need help on this closed connection
    getting oracle error: java.sql.sqlrecoverableException: Closed Connection when running a java application using tomcat api to oracle 11g database EE 11.2.0.3.0 on windows 2008 R2
    The process is reading data from an Oracle database using user_sdo_geom_metadata , memory allocated to DB is 5GB, java pool size 1G allocated , below is the code which gets data from Oracle
    <NamedDataSourceDefinition:NamedDataSourceDefinition xmlns:NamedDataSourceDefinition="http://www.mapinfo.com/mxp" xmlns="http://www.mapinfo.com/mxp" xmlns:gml="http://www.opengis.net/gml"xmlns:ns2="http://www.mapinfo.com/midev/service/common/v1" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.mapinfo.com/midev/service/namedresource/v1"version="MXP_WorkSpace_1_5"> 
    <ConnectionSet/> 
    <DataSourceDefinitionSet> 
    <DBDataSourceDefinition id="TXLANDMARKS"> 
    <DataSourceName>txlandmarks</DataSourceName> 
    <ConnectionMember> 
    <InlineDBConnection dbType="oracle"> 
    <JDBCDriverParameters> 
    <JDBCUrl>jdbc:oracle:thin:@NOIORAENT2K8-64:1521:FMETEST</JDBCUrl> 
    <DriverPropertySet> 
    <Property name="user" value="NOIDADATADEV"/> 
    <Property name="password" value="mndata"/>
    </DriverPropertySet>
    </JDBCDriverParameters>
    </InlineDBConnection>
    </ConnectionMember>
    <DBTable owner="NOIDADATADEV" useQuotes="true">TXLANDMARKS</DBTable>
    </DBDataSourceDefinition>
    </DataSourceDefinitionSet>
    <DataSourceRef ref="TXLANDMARKS"/>
    </NamedDataSourceDefinition:NamedDataSourceDefinition>
    Both the machines can ping to each other successfully, no firewall exists between them, these are connection setting been used in pooling-datasource-factory.properties
    poolingDataSourceFactoryClass=com.mapinfo.midev.dbms.jdbc.TomcatDataSourceFactory
    # what follows are properties specific to com.mapinfo.midev.dbms.jdbc.TomcatDataSourceFactory
    # defaultAutoCommit - the default auto commit state of the connection. if
    # not set the assumes the driver default
    # defaultAutoCommit =
    # (int) The maximum number of active connections that can be allocated from # this pool at the same time. The default value is 20
    maxActive = 10
    # (int) The maximum number of connections that should be kept in the pool at # all times. Default value is maxActive. Idle connections are checked # periodically (if enabled) and connections that been idle for longer than
    # minEvictableIdleTimeMillis will be released.
    maxIdle = 10
    # (int) The minimum number of established connections that should be kept in  the pool at all times. The connection pool can shrink below this number if # validation queries fail. Default value is 10
    minIdle = 5
    # (int)The initial number of connections that are created when the pool is # started. Default value is 10
    initialSize = 5
    # (int) The maximum number of milliseconds that the pool will wait (when # there are no available connections) for a connection to be returned before # throwing an exception. Default value is 30000 (30 seconds)
    # maxWaitMillis = 30000
    # (int) The number of milliseconds to sleep between runs of the idle # connection validation/cleaner thread. This value should not be set under 1
    # second. It dictates how often we check for idle, abandoned connections,
    # and how often we validate idle connections. The default value is 5000
    # (5 seconds).
    # timeBetweenEvictionRunsMillis = 5000
    # (int) The minimum amount of time an object may sit idle in the pool before
    # it is eligible for eviction. The default value is 60000 (60 seconds).
    # minEvictableIdleTimeMillis = 60000
    # (boolean) Flag to remove abandoned connections if they exceed the
    # removeAbandonedTimout. If set to true a connection is considered abandoned
    # and eligible for removal if it has been in use longer than the
    # removeAbandonedTimeout Setting this to true can recover db connections
    # from applications that fail to close a connection. See also
    # logAbandoned The default value is false.
    # removeAbandoned = false
    # (int) Timeout in seconds before an abandoned(in use) connection can be
    # removed. The default value is 60 (60 seconds). The value should be set to
    # the longest running query your applications might have.
    # removeAbandonedTimeout = 60
    # (boolean) Flag to log stack traces for application code which abandoned a
    # Connection. Logging of abandoned Connections adds overhead for every
    # Connection borrow because a stack trace has to be generated. The default
    # value is false.
    # logAbandoned = false
    # (long) Time in milliseconds to keep this connection. When a connection is
    # returned to the pool, the pool will check to see if the now
    # - time-when-connected > maxAge has been reached, and if so, it closes the
    # connection rather than returning it to the pool. The default value is 0,
    # which implies that connections will be left open and no age check will be
    # done upon returning the connection to the pool.
    # maxAgeMillis = 0

    Hi,
    I understand that you have raised a SR for this issue which is being worked upon by our team.
    Additionally, please note that the "Closed connection" error typically happens because a timeout parameter of some sort timed out the connection. This could be a parameter specified in your datasource, in your application code, or network (such as a firewall).
    You may also want to -
    1.  check your database to be sure it is not timing out connections.
    2.  Make sure your network is running efficiently and that it can provide fast connections,
    3. Check your Java Virtual Machine (JVM) Code Cache For Oracle Enterprise Data Quality for any memory related issues
    Thanks,
    Shwet

  • About database's  "closed  connection"

    i have stand a database called "TMIS",but now i can't start it ,after i put in the ID and the password,it always show me a message : "closed connection",i don't know what to do to help the "TMIS" start ,i tried many methods ,such as changing the listener.ora ,but it didn't help.
    the service "TMIS" always showed the status "UNKOWN",I don't know the reasons to cause my database can't connection,here is my /etc/hosts and the listener.ora
    #/etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    #here 127.0.0.1, actually i change to my own ip address
    #listener.ora
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST =localhost.localdomain)(PORT = 1521))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /opt/oracle/product/9.2.0)
    (PROGRAM = extproc)
    (SID_DESC =
    (GLOBAL_DBNAME = TMIS)
    (ORACLE_HOME = /opt/oracle/product/9.2.0)
    (SID_NAME = TMIS)
    ###why there was another service called "PLSExtProc")
    LSNRCTL> services
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    Service "TMIS" has 1 instance(s).
    Instance "TMIS", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    please help me solve this question ,i'm confused by this problem.
    thank you very very much!!!
    my email address is [email protected],please connect with me !!

    ORA-12705: Cannot access NLS data files or invalid environment specified
    Cause: Either an attempt was made to issue an ALTER SESSION command with an invalid NLS parameter or value; or the environment variable(s) NLS_LANG, ORA_NLSxx, or ORACLE_HOME was incorrectly specified, therefore the NLS data files cannot be located.
    Action: Check the syntax of the ALTER SESSION command and the NLS parameter, correct the syntax and retry the statement, or specify the correct directory path/values in the environment variables.
    Set your NLS environment variable Correctly
    SQL> show parameter nls
    NAME TYPE VALUE
    nls_calendar string
    nls_comp string
    nls_currency string
    nls_date_format string
    nls_date_language string
    nls_dual_currency string
    nls_iso_currency string
    nls_language string AMERICAN
    nls_length_semantics string BYTE
    nls_nchar_conv_excp string FALSE
    nls_numeric_characters string
    NAME TYPE VALUE
    nls_sort string
    nls_territory string AMERICA
    nls_time_format string
    nls_time_tz_format string
    nls_timestamp_format string
    nls_timestamp_tz_format string
    SQL>

  • How to reopen a closed connection?

    If I'm working on a worksheet, and I lose connection, how do I reopen it?
    I try running my code, and the Query Result just says "Closed Connection".
    The little connection dropdown list on the top-right corner of the screen gets grayed out when I lose connection.
    I can do Control N, and copy/paste my code into the new worksheet window,
    but that seems like the wrong way to do it.
    Is there any way to just reconnect using my current worksheet window?
    Thank you.

    SQL Developer Shows "Connection Closed" Error When Running a Query (Doc ID 1297692.1)
    Applies to:
    Oracle SQL Developer - Version: 2.1.1 and later [Release: and later ]
    Microsoft Windows x64 (64-bit) - OS Version: 7
    Symptoms
    The creation of a new connection goes through fine and the "Test" connection functionality and returns success status. While trying to view any tables, functions, procedures, etc., a "connection closed" message is displayed. Also, running any query returns the same "connection closed" message.
    The following error message is seen in the command window:
    Exception initializing 'oracle.dbtools.raptor.plsql.PLSQLAddin' in extension 'Oracle SQL Developer': java.lang.NoClassDefFoundError: com/sun/jdi/Bootstrap at oracle.jdevimpl.debugger.jdi.DebugJDIConnector.getVersion(DebugJDIConnector.java:30)
    Cause
    The SQL Developer download for windows 64-bit version 7 does not come bundled with the jdk. The requirement is to use jdk ver 1.6_11 or above. If the jdk used by the SQL Developer does not meet this requirement, the above mentioned exception happens.
    Solution
    1) Specify the full path to the right version of the jdk in the
    \sqldeveloper\bin\sqldeveloper.conf file in order to make sure that the SQL Developer points to the right jdk such as shown below:
    SetJavaHome C:\<full path>\jdk1.6.0_X
    2) Set the ORACLE_HOME env variable to the SQL Developer install location.
    Set ORACLE_HOME=<TOP_OF_SQLDEV_INSTALLATION location>

  • Web Service exception: Closed Connection

    I build a J2EE 1.3 Web Service using JDeveloper 10.1.3 by generating it from a PL/SQL procedure. It works fine on the embedded server and even on the standalone OC4J. When I deploy it on an OAS 10.1.3 it works fine initially but the day after I start to receive the following SOAP message:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <SOAP-ENV:Body>
    - <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Server.Exception:</faultcode>
    <faultstring>java.sql.SQLException: java.sql.SQLException: Closed Connection</faultstring>
    <faultactor>/login/LoginTesthire</faultactor>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    When I program a non-web application I use the following code to connect to and query a SQL Server database (I have omitted the try -catch sections):
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    String url = "jdbc:sqlserver://localhost:2766;databaseName=Cosmotim;IntegratedSecurity=true";
    Connection conn = DriverManager.getConnection(url);
    Statement s1=conn.createStatement();
    String select="SELECT * FROM [Table name]";
    ResultSet DBSet=s1.executeQuery(select1);But when I use the same code in a Web Service method with return type String and I try to deploy the Web service (to Java System Application Server PE 9 with NetBeans) I get many error messages and I can't deploy the service.
    I cannot understand why I can't deploy this WS but I can deploy other Web Services which do not use database connectivity.

  • "WARNING! Closed connections to peer [standby IP] database! Please restart peer node to bring databases in sync!!"

    i have a two appliances of NAC Manager, i want to make a failover, but i only connect them with a crossover cable on eth1,
    is it neccesary conect a serial cable?, because when i try to verify a failover  they appear  this:
    “WARNING! Closed connections to peer [192.168.0.254] database! Please restart peer node to bring databases in sync!!” in each one

    Hi. I had a lot of those messages. In my scenario the failover bundle works OK during certain time but ocassionally the hearbeat fails (never knew why) and the warning messages appeared. Since there's no sync anymore the config in both manager will be different, so the very first thing to do is to backup the configuration. Please notice if the current active NAM is the primary or the secondary NAM (it's necessary to know this information for the later steps).
    Then you will have to stop both NAM (service perfigo stop)
    Now there's an extra step only if the last active NAM was the secondary : you will have to restore the backup into the primary NAM (since this NAM will have an outdated configuration).
    Now back to the regular steps. You must start both NAM . The primary NAM will be the new active , synchronization will take some minutes, after that the "warning" will be cleared.
    Please rate if it helps.

  • JDBC "Closed Connection" Problem

    Hi All,
    I have a 903 BC4J application that has starting getting "JBO-30003: The application pool (P3iDdmModuleLocal) failed to checkout an application module due to the following exception: oracle.jbo.DMLException: JBO-26066: Error during rollback."
    The root cause, however, is "java.sql.SQLException: Closed Connection". Under what circumstances would this occur? The 9i db is not configured with a timeout and, therefore, should not be closing connections at that end.
    Shouldn't the connection pool manager capture invalid connections in the pool before the AppMod issues this message?
    How can I recover from this error?
    All help much appreciated! Thanks!
    Paul

    ApplicationModule appModule;
    //Obtain oracle.jbo.Transaction
    Transaction transaction=appModule.getTransaction();
    //Connect with a connect method or connectToDataSource method.
    transaction.connect("Connection URL");

  • Java.sql.SQLException: Closed Connection from Custom Identity Service

    Hi,
    Here is an issue I am trying to resolve:
    Platform: Oracle BPEL 10.1.2
    OS: Red Hat Enterprise Linux ES release 4 (Nahant Update 4)
    Please note that the whole thing has been working in other same type of installations (e.g. RedHat, Windows, Developer BPEL on Windows & Linux) but this seems to be something special on this server. Any help will be appreciated:
    This actually work for sometime (2-3 hours) and then suddenly stops working even if we don't do any transaction on it.
    Thanks,
    Bipul Dutta.
    Error stack:
    09/08/17 12:45:25 CustomIdentityService::authenticateUser():: begin
    ############# inside authenticateUser
    09/08/17 12:45:25 CustomIdentityService::user authenticated
    ############# inside getUser()
    09/08/17 12:45:25 java.sql.SQLException: Closed Connection
    09/08/17 12:45:25      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)
    09/08/17 12:45:25      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
    09/08/17 12:45:25      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:239)
    09/08/17 12:45:25      at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:930)
    09/08/17 12:45:25      at oracle.jdbc.driver.PhysicalConnection.prepareStatement(PhysicalConnection.java:826)
    09/08/17 12:45:25      at oracle.tip.pc.services.identity.FAMDBProvider.getUser(FAMDBProvider.java:418)
    09/08/17 12:45:25      at oracle.tip.pc.services.identity.FAMCustomIdentityService.lookupUser(FAMCustomIdentityService.java:101)
    09/08/17 12:45:25      at oracle.tip.pc.services.hw.worklist.WorklistService.authenticateUser(WorklistService.java:333)
    09/08/17 12:45:25      at com.famis.web.service.core.humanworkflow.service.AbstractTaskWebService.getBpelContext(AbstractTaskWebService.java:20)
    09/08/17 12:45:25      at com.famis.web.service.core.humanworkflow.service.GetTasksWebServiceImpl.process(GetTasksWebServiceImpl.java:51)
    09/08/17 12:45:25      at com.famis.web.service.core.humanworkflow.service.TaskWebServiceImpl.process(TaskWebServiceImpl.java:68)
    09/08/17 12:45:25      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    09/08/17 12:45:25      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    09/08/17 12:45:25      at java.lang.reflect.Method.invoke(Method.java:324)
    09/08/17 12:45:25      at org.apache.axis.providers.java.MsgProvider.processMessage(MsgProvider.java:141)
    09/08/17 12:45:25      at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
    09/08/17 12:45:25      at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    09/08/17 12:45:25      at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    09/08/17 12:45:25      at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    09/08/17 12:45:25      at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
    09/08/17 12:45:25      at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
    09/08/17 12:45:25      at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
    09/08/17 12:45:25      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    09/08/17 12:45:25      at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    09/08/17 12:45:25      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    09/08/17 12:45:25      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:835)
    09/08/17 12:45:25      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:341)
    09/08/17 12:45:25      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:816)
    09/08/17 12:45:25      at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:231)
    09/08/17 12:45:25      at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:136)
    09/08/17 12:45:25      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
    09/08/17 12:45:25      at java.lang.Thread.run(Thread.java:534)
    <2009-08-17 12:45:25,877> <ERROR> <tmobilet.collaxa.cube.services> <PCException::<init>> User is not found.
    <2009-08-17 12:45:25,877> <ERROR> <tmobilet.collaxa.cube.services> <PCException::<init>> User "BSAUNDE4" is not found in realm "tmobilet".
    <2009-08-17 12:45:25,877> <ERROR> <tmobilet.collaxa.cube.services> <PCException::<init>> Check the error stack and fix the cause of the error. Contact
    Edited by: user11798418 on Aug 17, 2009 10:30 AM

    >
    I have my application jar on the server, and launch this JFrame application from the browser. ><zen question>
    Which particular 'the browser'? What version of what browser running on what OS?
    </zen question>
    The reason I ask is that it is up to the browser to call an applet's stop()/destroy() methods and if they do not do so - there is almost nothing we as developers can do about it.
    If you need such reliable shut down behaviour, it would be best to launch the applet or frame using Java Web Start.

  • Got "closed connection" via OEM 10.1.0.2.0

    Hello,
    please help.....
    I installed OEM version 10.1.0.2.0 on windows 2000 PC. All the database instances are displayed under Network Navigator. when i log on to the database either as normal / sysoper /sysdba, I got "closed connection" error right after clicked OK on the login window.
    can anyone give me suggestion/ references to this issue?
    many thanks.

    Check firewall configurations on the PC to see if it is blocking the Listener port 1521. Also check the setting of SQLNET.AUTHENTICATION_SERVICES = in $ORAACLE_HOME/network/admin/sqlnet.ora

  • Java.sql.SQLException: Closed Connection error when invoking web service

    Hi
    I've assembled a simple web service for an Oracle PL/SQL package and deployed it on a Standalone OC4J, when I come to invoke it on the Oracle Enterprise Manager screen I'm getting the following returned within the envelope body:
    <env:Body>
    <env:Fault>
    <faultcode>env:Server</faultcode>
    <faultstring>Internal Server Error (serialization error: java.sql.SQLException: java.sql.SQLException: Closed Connection)</faultstring>
    </env:Fault>
    </env:Body>
    The function that is called within the database returns a user defined object that consists of a RAW value and an XMLTYPE. The function takes a string as a parameter, when I enter a string that I know will not return an object there is no error in the envelope body, only when there is an object to return does the error appear.
    Anyone have any suggestion as to why this is?

    I'm no further forward with this: has anyone assembled, deployed and invoked a web service that returns a XMLTYPE?? I know this should be possible but I think there's maybe some manual intervention required with the classes created with webservicesassembler: I'd really appreciate it if anyone with any experience of this kind of thing could help me think this through.

Maybe you are looking for