[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1312) Unclosed ResultSet when using Identity

Gail Badner (JIRA) noreply at atlassian.com
Thu Oct 18 02:27:39 EDT 2007


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

Gail Badner resolved HHH-1312.
------------------------------

    Resolution: Fixed

Thanks, Christian. I made the change as you suggested and checked that the ResultSet was property closed in the debugger. This should take care of the memory leak.

Fixed in trunk / 3.2 .

> Unclosed ResultSet when using Identity
> --------------------------------------
>
>                 Key: HHH-1312
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1312
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1 rc2, 3.1 rc3, 3.1
>         Environment: JBoss 4.0.3SP1
> Hibernate 3.1rc2
> Java 1.5.0_06
> MSSQLServer 2000
>            Reporter: Michael Samblanet
>            Assignee: Gail Badner
>            Priority: Minor
>             Fix For: 3.2.6, 3.3
>
>
> The code around AbstractEntityPersister.java line 1969 obtains a result set using GetGeneratedKeysHelper.getGeneratedKey
> but the result set is never closed by this function nor the functions it calls.  The issue was exposed by the
> message below in JBoss 4.0.3 SP1.
> This is an EJB3 application on JBoss using MSSQLServer 2000 and we are persisting an object with a primary key using an
> identity data type.
> A review of the Hibernate 3.1 source code seems to indicate it has the same issue.
> 11:29:30,817 WARN  [WrappedConnection] Closing a result set you left open! Please close it yourself.
> java.lang.Throwable: STACKTRACE
>         at org.jboss.resource.adapter.jdbc.WrappedStatement.registerResultSet(WrappedStatement.java:572)
>         at org.jboss.resource.adapter.jdbc.WrappedStatement.getGeneratedKeys(WrappedStatement.java:501)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.hibernate.util.GetGeneratedKeysHelper.getGeneratedKey(GetGeneratedKeysHelper.java:59)
>         at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:1969)
>         at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2404)
>         at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:37)
>         at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:243)
>         at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:269)
>         at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:167)
>         at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:101)
>         at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
>         at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
>         at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
>         at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:590)
>         at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:568)
>         at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:130)
>         at org.jboss.ejb3.entity.InjectedEntityManager.persist(InjectedEntityManager.java:97)
>         <snip>

-- 
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