2 Replies Latest reply on May 10, 2002 1:50 AM by Matt Baird

    getting handle to a real connection?

    Matt Baird Newbie

      If I use a statement to get it's connection (stmt.getConnection()) should I be getting the raw, real JDBC connection from the driver vendor (in my case inet), or should I be getting the wrapped connection (localConnection).

      If I use the resultset to get the statement, I end up getting the raw statement because resultset is not wrapped, then I can end up getting a raw connection and calling close on it. Then my code is very sad :(

      is this a known issue?

        • 1. Re: problems with Castor JCA
          Matt Baird Newbie

          I'd really like to see what you've come up with and get the config into the examples directory, especially if you can get the castor mods into castor. If not maybe we'll find a way to keep them here.

          I labeled the FAQ entry with datasources since I thought most people wouldn't know what jca was;-) so I messed up the experts instead, sorry.

          If you are using a local tx adapter and getting the "you aren't getting the semantics you expect" message it means the tx manager thinks there is more than one resource manager in a transaction and is telling you. If failure occurs in the commit your resource managers may be left in an inconsistent state with automatic recover not possible.

          Usually this happens when you use jms and a datasource in one tx.

          Maybe its time for a FAQ on this one too.

          • 2. Re: getting handle to a real connection?
            David Jencks Master

            yes, someone else complained too. I agree it would be more convenient for some users if going back from the resultset gave you the original connection wrapper. I'm reluctant to implement it because there are so many methods in ResultSet and I don't see the need to go backwards. Why don't you already have the connection?

            If there continues to be enough demand I will consider implementing a ResultSet wrapper.