-->
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.  [ 2 posts ] 
Author Message
 Post subject: Using SessionFactory among context
PostPosted: Wed Jun 25, 2008 6:04 am 
Newbie

Joined: Mon Dec 11, 2006 5:18 am
Posts: 9
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.2.6.ga
Spring:2.0.8
Name and version of the database you are using:SqlServer2005
Java version: 1.5
Tomcat version: 5.5.25
OS: Fedora 8


We have the following scenario:
- Web Application running on tomcat and using hibernate
- Web service running on another tomcat using hibernate
- Both have the same server/hibernate configurations and using Spring to instatiate their SessionFactory

WebApp make a call to WebService that returns a complex object that contains a reference to a SessionFactory(the one built on WebService context).

The questions are:
1- What about SessionFactory serialization ?
2- Is this a good pratice passing SessionFactory cross different context on different machines ?
3- Are there some perfromance pitfall (processor or network)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 25, 2008 10:28 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
I don't think you're going to be able to serialize a SessionFactory and pass it across the network.

The XA specification deals with distributed transactions. What you really want is to have all the various players take part in a single, common transaction. That's the game you should play.

Distributed transactions across a web service are always painful. Let us know how you fare.

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