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

Beto Neto (JIRA) noreply at atlassian.com
Mon Dec 14 11:45:08 EST 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Beto Neto updated HHH-4557:
---------------------------

    Attachment: hibernateBug.zip

A JUnit(4) testcase to reproduce the bug.

> 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
>         Attachments: hibernateBug.zip
>
>
> 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