-->
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: Transactions that spans multiple webapps
PostPosted: Wed Jun 02, 2004 3:38 am 
Newbie

Joined: Tue Jan 06, 2004 11:34 am
Posts: 3
Location: Norway
I have read around the forums for some time now, but can't find a good answer to this question.

If I have a webapp deployed as two war files in a tomcat (or similar) servlet container. These two war files access the same (mysql innodb) database, and usage of tables overlap. Is it possible for one web application to be aware of transactions started in the other web application, and vice-versa?

I have read that the hibernate mappings must be bundled with each webapp that is deployed. Will this stop me from making the webapps aware of each others transactions? (As each webapp uses its own cache and JTA?)

We are considering to use Hibernate in a heavy load environment, and would like to split our application into different webapps on the same tomcat instance - for ease-of-maintainability and upgrades.

Anyone have som ideas or thoughts about this?

Regards,
Olve


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 02, 2004 5:43 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Do you expect a webapp to call another webapp ?
Cascaded calls through HTTP cannot be Transactional.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 4:43 am 
Newbie

Joined: Tue Jan 06, 2004 11:34 am
Posts: 3
Location: Norway
Sorry about the crosspost, I didn't get any answers in beginners section, and I started to doubt this was a beginners problem.

What I want to do is having two web-applications, where each other knows about the other webapp's transactions.

As far as I understand, Hibernate can keep track of the transactions using JTA, but only within the web-application that started it. Also lock information are only kept in the cache (oposed to using the native db-vendors locking mechanism)?

If rows are locked by a transaction in webappA, and another user uses webappB trying to change the same rows, how can I make hibernate react to that situation?

Can I do this by deploying the hibernate DAO and Managers by itself, and have webappA and B lookup up the specific managers through JNDI? Maybe using the Spring framework. Perhaps putting only the session object in the JNDI database?

Or is it possible at all? Maybe using a clustered cache? I hope for a simpler solution, as the webapps will be located on the same physical machine.. I am starting to think that I should rethink the architecture of this webapp..


Sorry if I am a bit vague in my explanations, as I am quite new to hibernate. We are considering to switch from JBoss and cmp2.0 to tomcat and hibernate. So I am exploring the possibilities. I like what I see, but I am trying to get a hold of the limitations of Hibernate - to see what it can and can't do..


Thanks for the help so far,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 03, 2004 2:34 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
olve wrote:
As far as I understand, Hibernate can keep track of the transactions using JTA, but only within the web-application that started it. Also lock information are only kept in the cache (oposed to using the native db-vendors locking mechanism)?

JTA is completly delegated to you JTA TM, so Hibernate is only limited to it.
Hibernate *do not ever* put pessimistic lock information in the middle tier.
Only optimistic locking is send through layers, but there is no relationship.

Quote:
If rows are locked by a transaction in webappA, and another user uses webappB trying to change the same rows, how can I make hibernate react to that situation?

Read the optimistic locking chapter, it is not related to Db Transaction

Quote:
Can I do this by deploying the hibernate DAO and Managers by itself, and have webappA and B lookup up the specific managers through JNDI? Maybe using the Spring framework. Perhaps putting only the session object in the JNDI database?

I can't really understand what you've in mind. Can you do that with a plain old JDBC DAO ? If yes, you can do it with Hibernate.

Quote:
Maybe using a clustered cache? I hope for a simpler solution, as the webapps will be located on the same physical machine.. I am starting to think that I should rethink the architecture of this webapp..

You"re mixing differents issues. Yes, you should reconsider your architecture AFAIK

_________________
Emmanuel


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.