-->
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: OpenSessionInView and/or distributed deployment
PostPosted: Tue Mar 14, 2006 7:45 pm 
Newbie

Joined: Tue Mar 14, 2006 5:06 pm
Posts: 4
Hibernate version: 3.1.2 planned
JBoss version: 4.0.3sp1
Name and version of the database you are using: MySQL 5.0

We are building a web app and I would like to use OSiV for lazy loading in the presentation layer. I have already read and think I understand:
http://www.hibernate.org/42.html
http://www.hibernate.org/43.html

My current plan is to use a single session for both the presentation layer and business layer, but use two (or more) transactions. This would be:
* one (or more) txns for business operations
* one read-only txn for resolving lazy refs in the presentation layer

My current understanding is that using OSiV implies co-locating the presentation layer and business layer on the same JVM/server (or tier of servers). This has the benefits of sharing the session cache and easy lazy loading, but (presuming we've chosen this architecture for the right, requirements-based reasons) the organizational disadvantage of convincing CTOs that Tier-per-Layer is not the only way to build "enterprise" apps.

Is the above correct?

If I was to attempt to lazy-load in the presentation layer AND deploy the presentation layer and business layers to separate physical tiers (or separate JVMs) then I would have to open a separate session for each tier, eliminating the benefits of a shared session cache and, possibly worse, missing flushed updates from the business layer (if my presentation session was opened prior to the business invocation). This seems to be more work and less performant than simple eager loading from the business tier.

Am I thinking about this correctly? Is OSiV with distributed deployment a realistic option?

Thanks. --Dan


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 3:29 pm 
Newbie

Joined: Tue Mar 14, 2006 5:06 pm
Posts: 4
For anyone that happens upon this post in the future, here are a few pages that begin to answer the above question:

Hibernate in a Layered Architecture -- http://www.hibernate.org/124.html
Remote Lazy Loading -- http://www.hibernate.org/377.html
Distributed Objects With Hibernate -- http://www.hibernate.org/161.html


Top
 Profile  
 
 Post subject: Re: OpenSessionInView and/or distributed deployment
PostPosted: Thu Mar 16, 2006 8:11 am 
Beginner
Beginner

Joined: Thu Aug 19, 2004 5:36 am
Posts: 30
Location: Italy
At the beginning of last year I faced with same architectural problem.

In order to have benefits from OSiV pattern, your business logic and presentation tier must fall under the same servlet container.
Otherwise you have to deal with DTO from EJB server to servlet container (business session container).

First of all: I don't know neither EJB no JBoss. I rejected a full enterprise architecture after months of study.
Obviously, this decision came at 99% from my application requirements.
In short, for me:

- complex user interfaces, complex business objects (parent/child, complex relationships), complex business logic? No EJB, DTO and full three-tier (database, ejb engine, session application server(s) ) if application users are less than hundreds. I users are more.... non web thin client??

- simple user interfaces, simple to complex busness objects, simple business logic? Full three-tier if you count users in hundreds or thousands. Otherwise a simple database+servlet container(s) (also with load balancing cluster, but no session failover (not with tomcat!)) could work quite well.

So, you have to evaluate carefully your needs, because OSiV could really boost your userinterfaces and you could get a user responsiveness near to client/server.

On the other end, if you REALLY need scalability, obtain it from tomcat clusters could be difficult or not possible.

Not an easy choice.


Delta


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.