-->
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.  [ 7 posts ] 
Author Message
 Post subject: NHibernate Object Server
PostPosted: Sun Oct 23, 2005 1:41 pm 
Newbie

Joined: Sun Oct 23, 2005 1:17 pm
Posts: 2
Location: Jacksonville, FL
I have multiple instances of NHibernate running on the same server. This seems somewhat wasteful. I was wondering if anyone had a solution where they ran one shared instance of NHibernate (similar to Java EJBs in an app server) shared by the various app instances.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 9:52 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
You should share the SessionFactory (by making it singleton).

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 3:37 pm 
Hey thanks for the reply Pixel. I did make the SessionFactory a singlton. Problem is that my system is spread out over several program instances, hardware drivers, web-app, HL7 interface etc. All seperate executables.

I was hoping there was some way to share the NHibernate instance (and caches) between multiple apps on the same server similar to how a Java application server can share EJBs over multiple apps within the app server.



KPixel wrote:
You should share the SessionFactory (by making it singleton).


Top
  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 2:46 am 
what you needed is an entprise server like com+ or ejb , its really a huge project, and i think you can wrap NHibernate with com+ to profer the function you need


Top
  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 3:18 am 
Beginner
Beginner

Joined: Tue Oct 25, 2005 2:44 am
Posts: 20
Location: Sydney, Australia
I would consider running it within a windows service and using .net remoting to communicate with it. A lot of people use this technique for custom session state servers etc.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 02, 2005 4:13 pm 
Regular
Regular

Joined: Thu May 12, 2005 10:12 am
Posts: 71
Location: Buenos Aires, Argentina
Sorry to drop so late into this thread, but kerry, could you explain a bit better this Windows Service/Remoting approach.

Sounds very interesting...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 7:35 pm 
Beginner
Beginner

Joined: Tue Oct 25, 2005 2:44 am
Posts: 20
Location: Sydney, Australia
Sorry for the late reply, just saw your post.

Basically you write a standard windows service using VS.NET that runs a single thread. You have one function call that is exposed via remoting that returns your ISession object from your factory.

Your client application then runs and when it needs an ISession makes a remote call to the windows service process to get it.

This is a pretty heavy handed approach however, it has greater overheads in both processing time (marshalling costs etc) and ongoing system maintainability (another component, another point of failure).

A singleton design at least only initialises once per process, and you don't get ongoing processing overheads.


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