2 Replies Latest reply on Jan 24, 2008 10:29 AM by marklittle

    Not closing connections with Oracle 10g

    smccauli

      Hi,

      I'm using oracle 10g, JbossTM 4.2.3SP5, and Hibernate 2. It seems like the Oracle connections are never closed which eventually leads to errors with Oracle; ORA-12514: TNS:listener could not resolve SERVICE_NAME. After doing some debugging I've found this code in com.arjuna.ats.internal.jdbc.ConnectionImple.close() :


      /*
      * We can't close the connection until the transaction
      * has terminated, so register a synchronisation here
      */

      getModifier();

      if (_theModifier != null && ((ConnectionModifier) _theModifier).supportsMultipleConnections()) {
      tx.registerSynchronization(new ConnectionSynchronization(_theConnection, _recoveryConnection));
      _theConnection = null;
      }

        • 1. Re: Not closing connections with Oracle 10g
          smccauli

          Somehow that post was submitted before I was complete. I think I was subconsciously tabbing over to format the source code and then hit space which caused the form to submit. Anyway back to business...


          getModifier() sets this._theModifier to null. So this block of code, registering the synchronization is never executed. I've created my own Modifier for Oracle 10g using com.arjuna.ats.internal.jdbc.drivers.modifiers.oracle_jndi as a template. This has fixed the close() problem. But is this the correct thing to do? Why was it not being closed before?

          Thanks,
          Sean

          • 2. Re: Not closing connections with Oracle 10g
            marklittle

            Post your code.