-->
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: Replication, load-balancing and JTA confusion
PostPosted: Tue Jul 05, 2016 11:06 am 
Newbie

Joined: Fri Jun 19, 2015 9:28 am
Posts: 3
So, we are currently running our webapp in Apache Tomcat and it uses Hibernate (older version, but we'll upgrade soon) as it's JPA provider, and as our user base grows we're looking into options for load-balancing before we get to a point where performance becomes a problem.
Pretty much every answer I've found when searching whether I need JTA (Java Transaction API) the answer is to always go for it, instead of a "resource-local" connection, however the only provider I found that is just a JTA provider and not a full-blown monstrosity with 5 other technologies I don't want is Bitronix.
And this is just on the Java side. But on the database end, where we use PostgreSQL, they have a ton of options for replication and as I understand it, they handle their own transactions.
For our webapp, we only have one rare scenario where we use a Serializable isolation level for the transaction. With most other transactions it doesn't matter if the data is outdated, because it won't harm us or the customers.

My questions are these:
  • Do we really need JTA even if we're not yet using a distributed database or running multiple instances of the webapp?
  • Does a synchronous replication solution like Postgres-XL cancel-out any benefits of JTA or does it make it more likely we would need JTA?
  • Does using JTA make having just one database even with multiple webapp instances more reliable?
  • Should we just switch from Tomcat to GlassFish (which has JAX-RS and JavaMail, that we also use), but keep using Hibernate? We do not use EJB, CDI, WebSockets and a lot of other J7EE technologies.


Top
 Profile  
 
 Post subject: Re: Replication, load-balancing and JTA confusion
PostPosted: Mon Jul 11, 2016 5:01 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
1. You don't need JTA if you only work with a single DataSource. Even with 1PC optimization, the JTA overhead is greater than RL.
2. Postgres synchronous replication is hidden away from the application-level transaction management, so there is nothing to worry about here. RL will work just fine here as well.
3. No. RL will work just fine here too since it relies on the transaction isolation level guarantees anyway.
4. Jax-RS and JavaMail can be integrated easily with Tomcat too, so if you don't need EJB, CDI, and the rest, you can go with Tomcat just fine.


Top
 Profile  
 
 Post subject: Re: Replication, load-balancing and JTA confusion
PostPosted: Wed Jul 13, 2016 3:54 am 
Newbie

Joined: Fri Jun 19, 2015 9:28 am
Posts: 3
Thank you. So we'll be good with Resource-local in Tomcat and (when we get to DB replication) synchronous replication for Postgres.


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.