-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate - Web Service
PostPosted: Wed Sep 10, 2008 2:54 am 
Newbie

Joined: Fri Jun 20, 2008 8:56 am
Posts: 15
I´m developing a Web Service that access a Database through Hibernate.
How can I make that all the processes launched when session is created for first time (entities mapping) to be executed when I initialize the WS and not the first time I make a query to database?

Thank´s.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 10, 2008 9:44 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Is the web service deployed as part of a web application? You could always have a context listener in the web app initialize the Session?

How is the web service implemented? POJO? Stateless Session Bean? And what services are you initializing?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 11, 2008 2:18 am 
Newbie

Joined: Fri Jun 20, 2008 8:56 am
Posts: 15
No, the WS isn´t part of a web application. It´s waiting for a client to make queries.
It is implemented in Java and it´s runnig on Glassfish.

I would need a way to start the processes that are automaticaly launched when session is created for fisrt time (entities mapping, etc) before I make a query to the WS.

IE: I start the WS and a client makes a query. The WS gets the session for first time, the mapping processes are launched:

configuring from resource: /hibernate.cfg.xml
Configuration resource: /hibernate.cfg.xml
Reading mappings from resource : /classes/User.hbm.xml
Mapping class: cac.classes.User -> usuarios
Reading mappings from resource : /classes/Department.hbm.xml
Mapping class: cac.classes.Department -> departamento
Reading mappings from resource : /classes/Incidence.hbm.xml
Mapping class: cac.classes.Incidence -> incidencias
Reading mappings from resource : /cac/classes/Section.hbm.xml
Mapping class: cac.classes.Section -> conexion

(it takes a few seconds)

I want that these processes to be executed before the first call.

Thank´s.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.