[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1474) SchemaUpdate Issue with hbm2ddl.auto property

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 21 13:01:06 EDT 2011


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

Steve Ebersole closed HHH-1474.
-------------------------------


Closing stale resolved issues

> SchemaUpdate Issue with hbm2ddl.auto property
> ---------------------------------------------
>
>                 Key: HHH-1474
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1474
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1.2
>         Environment: PostgreSQL 8.1.1 running on Windows XP SP2.  JDK 1.4.2.  
>            Reporter: Grant Ingersoll
>            Priority: Minor
>         Attachments: hib.tar.gz
>
>
> I am seeing some strange behavior using the hbm2ddl.auto property
> when set to update. I haven't seen anyone else with the same problem,
> so it is probably something I am doing.
> I have a simple mapping file named Junk (XML below). In my configuration file, I have set the hbm2ddl.auto to be update. When I do this, I get an exception when I try to begin a transaction stating that:
> java.sql.SQLException: com.mchange.v2.c3p0.PoolBackedDataSource at edf3f6 [...] has been closed() -- you can no longer use it.
> Now, if I change the hbm2ddl.auto value to be create or create-drop everything works fine in my test. I have included the pertinent test code,
> mapping and hibernate.cfg.xml code as an attachment. When I look at the logs
> I don't see anything too different. Note, that in the case of update, Hibernate is definitely talking to the database when it is starting up,
> it just throws the Exception when I try to open a transaction
> I have done some debugging of this, and it seems that the SchemaUpdate class is calling connectionProvider.close() on line 175, which then proceeds to destroy the data source on line 118 of the C3P0ConnectionProvider class. Then, when I go to begin doing my real work, by opening a transaction, it tries to get a new connection from the Data Source (which for some reason is the one that was just destroyed) and the PoolBackedDataSource throws the offending exception on line 234 because, as far as it is concerned, the Data Source has been destroyed.
> Since SchemaUpdate isn't being called when hbm2ddl.auto is set to create this is never an issue.
> I have my C3P0 properties set as in http://www.hibernate.org/hib_docs/reference/en/html/session-configuration.html#configuration-hibernatejdbc (which can be seen in the configuration I posted earlier.)
> Posted this on the forum a few days ago and did some debugging at http://forum.hibernate.org/viewtopic.php?t=955212

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