-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Help w/org.jboss.hibernate.jmx.Hibernate.buildSessionFactory
PostPosted: Thu Apr 06, 2006 9:16 pm 
Newbie

Joined: Thu Apr 06, 2006 8:41 am
Posts: 3
Location: Boston
Hi Folks,

I am running JBoss 4.02 that's running a series of applications, each of which has its own .har file. During startup, jboss sets up the SessionFactory before any of my own code is seen. I'm trying to integrate hibernate annotations as well as lucene.

I need to know how to intercept or override the buildSessionFactory() method in org.jboss.hibernate.jmx.Hibernate so that I can use an AnnotationConfiguration instead of a Configuration to instantiate the SessionFactory. Any hints as to how to go about this without re-building jboss?

Thanks for any help.

-Greg

Hibernate version: 3.2 RC1

Mapping documents: N/A

Code between sessionFactory.openSession() and session.close(): N/A

Full stack trace of any exception that occurs: N/A

Name and version of the database you are using: Oracle 10.1

The generated SQL (show_sql=true): N/A

Debug level Hibernate log excerpt: DEBUG
2006-04-06 19:40:03,538 DEBUG [org.jboss.system.ServiceController] starting service jboss.har:service=BspCoreHibernate
2006-04-06 19:40:03,538 DEBUG [org.jboss.hibernate.jmx.Hibernate] Starting jboss.har:service=BspCoreHibernate
2006-04-06 19:40:03,538 DEBUG [org.jboss.hibernate.jmx.Hibernate] Hibernate MBean starting; org.jboss.hibernate.jmx.Hibernate@b02f33 [ServiceName=jboss.har:service=BspCoreHibernate, JNDI=java:/hibernate/BspSessionFactory]
2006-04-06 19:40:03,538 DEBUG [org.jboss.hibernate.jmx.Hibernate] Building SessionFactory; org.jboss.hibernate.jmx.Hibernate@b02f33 [ServiceName=jboss.har:service=BspCoreHibernate, JNDI=java:/hibernate/BspSessionFactory]
2006-04-06 19:40:03,618 INFO [org.hibernate.cfg.Environment] Hibernate 3.2 cr1


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 07, 2006 10:00 am 
Newbie

Joined: Thu Apr 06, 2006 8:41 am
Posts: 3
Location: Boston
I figured out a method to resolve this ... I needed to brush up on my jboss admin skills. I created a custom MBean that looked like the existing HibernateMBean and called that from the hibernate-service.xml file. Updating my customized MBean allowed me to use my own AnnotationConfiguration so I could instantiate annotated classes.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 16, 2006 12:01 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
alternatively you might want to use JBoss EJB3, this is all done for you and you can inject Sessions rather than EntityManagers if you want to

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 8:27 am 
Newbie

Joined: Thu Apr 06, 2006 8:41 am
Posts: 3
Location: Boston
Thanks, we'll definitely do that once we migrate to that. In the meantime, it looks like what I have now will work for our current production deployment. Thanks,

-Greg


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.