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.