Issue Details (XML | Word | Printable)

Key: EJB-325
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Max Rydahl Andersen
Votes: 0
Watchers: 0
Operations

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

Any PersistenceExceptions should state which persistenceunit they are from

Created: 26/Nov/07 08:05 AM   Updated: 15/Jan/08 03:00 PM   Resolved: 15/Jan/08 02:29 PM
Component/s: None
Affects Version/s: 3.3.2.Beta1
Fix Version/s: 3.3.2.Beta2

Time Tracking:
Not Specified

Issue Links:
Relates
 

Participants: Emmanuel Bernard and Max Rydahl Andersen


 Description  « Hide

example from booting seam with multiple persistence.xml's in play:

FAILED CONFIGURATION: @BeforeClass init
javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:85)
at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
at org.jboss.seam.Component.callCreateMethod(Component.java:1997)
at org.jboss.seam.Component.newInstance(Component.java:1968)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)
at org.jboss.seam.init.Initialization.init(Initialization.java:555)
at org.jboss.seam.mock.BaseSeamTest.init(BaseSeamTest.java:939)
at org.jboss.seam.mock.SeamTest.init(SeamTest.java:42)
Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:409)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2006)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1289)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:691)
... 41 more
... Removed 26 stack frames

No context whatsoever on what persistence unit out of 2 that is the culrpit.

javax.persistence.PersistenceException: [test1unit] org.hibernate.HibernateException: Hibernate Dialect must be explicitly set

would have saved me alot of time ,)



Emmanuel Bernard added a comment - 26/Nov/07 05:01 PM

"Any persistenceException" cannot work because sometimes you don't know. but I'm happy to fix existing identified problems


Max Rydahl Andersen added a comment - 26/Nov/07 05:40 PM

ok so here you got one of them (exceptions during configuration of hibernate)


Max Rydahl Andersen added a comment - 26/Nov/07 06:00 PM

btw. being able to get the persistenceunit name from an EntityManager or EntityManagerFactory would be awsome too...I couldn't find a way and our delegates are just hibernate interfaces which does not know about it....and the logs reveals nothing.


Emmanuel Bernard added a comment - 15/Jan/08 02:11 PM

"btw. being able to get the persistenceunit name from an EntityManager or EntityManagerFactory would be awsome too...I couldn't find a way and our delegates are just hibernate interfaces which does not know about it....and the logs reveals nothing."

Max, can you describe the need and usage.


Emmanuel Bernard added a comment - 15/Jan/08 02:28 PM

Additional demand moved to EJB-329


Max Rydahl Andersen added a comment - 15/Jan/08 03:00 PM

being able to print out which of possible many available persistence units on the classpath that is relevant for the current entitymanager.

This is primarily to debug what the autodiscovery actually discovered and if you are running multiple entitymanagers logs are not enough if I can't link a specific instance to which of the many autodiscovered and/or manually/explicit configured EntityManagers i'm currently holding on to.