3 Replies Latest reply on Apr 5, 2011 3:04 PM by nickarls

    HttpSession -> Database connection

    nickarls

      Hi,

       

        I have to work with an Oracle Database and the PL/SQL uses a lot of temporary tables (per database connection) so having connections handed to you randomly from a connection pool will probably be an issue. Is it possible to write some sort of connector that would

       

      a) always give the same database connection to the same http session id client? or

      b) connect with a DB username/password and stick to that connection or

      c) some other solution that would fix a web client to a database connection

       

      Help is appreciated,

        - Nik

        • 1. HttpSession -> Database connection
          wdfink

          Hi Nicklas,

          my first idea was to lookup the connection from pool and store it within the session.

          But what about browser or network crash , maybe the session timeout must cleanup.

          I'm unsure whether this is a good idea.

           

          Do you can use one connection parallel with two session? or must it an exclusive usage?

          How the temporary tables handled, e.g. deleted if the session crash?

           

          Also you might open lots of connections in parallel.

          • 2. HttpSession -> Database connection
            nickarls

            Hmm, I don't think storing the connection yourself would be a good idea since I'm using injected persistence contexts anyway. I'd have to get in near the connection pool itself so JPA doesn't know someone is tampering with the connections ;-)

            • 3. HttpSession -> Database connection
              nickarls

              Any Oracle user around that have had to deal with temporary tables and connection pools?