[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4557) Query stealing connection from another query

Beto Neto (JIRA) noreply at atlassian.com
Mon Nov 9 12:47:09 EST 2009


Query stealing connection from another query
--------------------------------------------

                 Key: HHH-4557
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4557
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.6
         Environment: 3.2.6.ga, Oracle 10, Windows XP sp3
            Reporter: Beto Neto


To reproduce the bug:

Create a custom ConnectionProvider to close any connection at "closeConnection(Connection)" (extends from DriverManagerConnectionProvider), and plug it in hibernate using the system proerty "hibernate.connection.provider_class".

Than execute this test:
// set up the sessionFactory, and acquire a session..
Query qry = session.createQuery("select * from TABLE_WITH_2_RECORDS");
ScrollableResult sr = qry.scroll();
sr.next();
// now, before close the ScrollableResult, execute a uniqueResult...
qry = session.createQuery("select FIELD_1 from TABLE_WITH_2_RECORDS order by FIELD_1");
qry.uniqueResult();

sr.next(); // at this time occour a SQLException "Connection Closed: next"

The BUG occours when the uniqueResult() runs, because internaly it returns the connection to the Pool, and the current ConnectionProvider has the logic about CLOSE all connections returned.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list