[hibernate-issues] [Hibernate-JIRA] Updated: (EJB-368) Detached entity not reported consistently

Gail Badner (JIRA) noreply at atlassian.com
Wed Jul 9 02:23:12 EDT 2008


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

Gail Badner updated EJB-368:
----------------------------

    Attachment: HibernateTestReworkedPersist.zip

The default cascade (<cascade-persist/>) was removed from emailAddress.xml in  HibernateTestReworked.zip . This is why there was no exception when cascade-persisting the detached entity.

I'm attaching a new zip file (HibernateTestReworkedPersist.zip) that restores the default cascade and adds a few more tests.

When the test in HibernateTestReworkedPersist.zip is run, an exception is thrown when cascade-persisting the detached entity. This happens using both JDK 1.5.0_14-b03 and 1.6.0_03-b05, so this issue is still not reproducible.

> Detached entity not reported consistently
> -----------------------------------------
>
>                 Key: EJB-368
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-368
>             Project: Hibernate Entity Manager
>          Issue Type: Bug
>          Components: EntityManager
>    Affects Versions: 3.3.2.GA
>         Environment: ejb3-persistence-1.0.1.GA.jar
> hibernate-entitymanager-3.3.2.GA.jar
> hibernate-3.2.6.ga.jar
> postgresql-8.3-603.jdbc3.jar
> jdk 1.5.0_13/jdk 1.6.0_06
> Windows XP
>            Reporter: Henriette Harmse
>         Attachments: HibernateTest.zip, HibernateTestReworked.zip, HibernateTestReworkedPersist.zip
>
>
> The attached code does not fail consistently with a "detached entity" exception. 
> Under jdk 1.5 (tested with jdk 1.5.0_10 & 1.5.0_13) it fails with a detached entity exception which is correct. Running the same code against jdk 6 (tested with jdk 1.6.0_06 & jdk 1.6.0_03) passes and the records are written to the database.
> The same code works against jdk 1.5 (and jdk 6) as well when the <mapping-file>META-INF/emailAddress.xml</mapping-file> and <class>example.domain.EmailAddress</class> are commented out from the persistence.xml file. 
> The fact that this code does not fail consistently could cause developers to use Hibernate incorrectly which may only be apparent much later into the project.
> In order to run the example:
> 1. Create Postgres database called "example".
> 2. Create "example" user with username and password "example"
> 3. Edit the run.cmd and build.cmd files to set your JAVA_HOME.
> 4. Run "build.cmd".
> 5. Run "run.cmd".

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