Issue Details (XML | Word | Printable)

Key: EJB-257
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Emmanuel Bernard
Reporter: Khalil Bouhamza
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
z - Hibernate Entity Manager

EJB3Configuration should work wo having to call any of the configure(*)

Created: 07/Dec/06 03:07 PM   Updated: 19/Feb/07 01:36 PM   Resolved: 19/Feb/07 01:36 PM
Return to search
Component/s: EntityManager
Affects Version/s: 3.2.0.ga
Fix Version/s: 3.3.0.ga

Time Tracking:
Not Specified

File Attachments: 1. Java Source File EJB3ConfigurationHibernateCfgXmlInitTest.java (4 kB)

Environment:
Hibernate 3.2.0 GA
Hibernate Annotations 3.2.0 GA
Hibernate Entity Manager 3.2.0 GA

Bug Testcase Reminder (view):
REMINDER: Bug reports should generally be accompanied by a test case
Participants: Emmanuel Bernard and Khalil Bouhamza


 Description  « Hide

I am opening this issue following Emmanuel's request on http://forum.hibernate.org/viewtopic.php?p=2332948#2332948
The tescase attached is a junit Test that shows that an empty hibernate.cfg.xml and the call cfg.configure("/mypath/hibernate.cfg.xml") as shown in the reference documentation http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/configuration.html#setup-configuration-bootstrapping is needed for EntityManagerFactory programatic construction.
The TestCase shows two scnerios with and without hibernate.cfg.xml. The scenarios are building a EntityManagerFactory and either try to persist or retrive an entity of type org.hibernate.ejb.test.Distributor included in HEM's test suite. The hibernate.cfg.xml file is genrated at Runtime and deleted upon VM exit, the varaiable HIBERNATE_CFG_XML_DIR should point to a folder on the classpath. It is created within the initWithHibernateCfgXML method and it is really a file with the bear minimum of empty tags. There are four tests, two failing and the other two passing, the passing tests create the temp XML config file if not already created, and then make the cfg.configure(resource) call, then simply invoke the corresponding failing test.
I hope the TestCase and the above explanation are describing the issue properly.



There are no comments yet on this issue.