Hi,
I am currently working on a project to create a web application without using EJBs.This application currently runs on tomcat.At the backend i am using a MySQL database.There are a lot inserts that i have to perform.Currently what i have done is,i have written a helper class where i invoke a single method which does all the inserts.I have marked this method as 'Synchronized'.
I think for a limited number of users this approach might work fine but what if the number of users accessing the web apps is large.Can you please suggest some better approach to handle scalability and also transactions.
I thought of using JTA but i think with tomcat we need to download some transaction manager to use JTA.
rajat
-
Web Application Without EJBS,How to make it scalable. (6 messages)
- Posted by: Rajat M
- Posted on: October 15 2005 00:35 EDT
Threaded Messages (6)
- Web Application Without EJBS,How to make it scalable. by Rich Hill on October 20 2005 10:50 EDT
- Web Application Without EJBS,How to make it scalable. by Rajat M on October 24 2005 04:31 EDT
- Web Application Without EJBS,How to make it scalable. by Dmitri Maximovich on October 27 2005 23:33 EDT
- Good Database Driver by Mica Cooper on October 28 2005 08:26 EDT
- Web Application Without EJBS,How to make it scalable. by Jose Ramon Huerga Ayuso on November 09 2005 17:30 EST
- scalable Transactions for Web Applications for web applications by nitin dhawas on April 17 2010 07:55 EDT
-
Web Application Without EJBS,How to make it scalable.[ Go to top ]
- Posted by: Rich Hill
- Posted on: October 20 2005 10:50 EDT
- in response to Rajat M
You could try using Spring's AOP abilities for transactions. -
Web Application Without EJBS,How to make it scalable.[ Go to top ]
- Posted by: Rajat M
- Posted on: October 24 2005 04:31 EDT
- in response to Rich Hill
Thanks for the suggestion,i will try using the spring framework. -
Web Application Without EJBS,How to make it scalable.[ Go to top ]
- Posted by: Dmitri Maximovich
- Posted on: October 27 2005 23:33 EDT
- in response to Rajat M
If you're just using one resource (database) there is no need to use JTA and/or TransactionManager. Local transactions should do. You can use local transactions manually (connection.setAutoCommit(false), conncetion.commit()/rollback()) or use almost any of the frameworks, including Spring. -
Good Database Driver[ Go to top ]
- Posted by: Mica Cooper
- Posted on: October 28 2005 08:26 EDT
- in response to Rajat M
A good database driver with pooling will solve your issues. It will include transactions and pool your connections.
If you are opening a single connection and trying to 'pipe' everything through it, you will have problems scaling. This is what pooling is for. -
Web Application Without EJBS,How to make it scalable.[ Go to top ]
- Posted by: Jose Ramon Huerga Ayuso
- Posted on: November 09 2005 17:30 EST
- in response to Rajat M
There are a lot inserts that i have to perform.Currently what i have done is,i have written a helper class where i invoke a single method which does all the inserts.I have marked this method as 'Synchronized'.I think for a limited number of users this approach might work fine but what if the number of users accessing the web apps is large.Can you please suggest some better approach to handle scalability and also transactions.
Of course, you can use no EJB at all and get an scalable application. On the other hand, you should avoid using 'synchronized' to protect the insert operations, because if in the future you need to start a second JVM, this approach is not going to work. The best you can do, is to start a local transaction, perform all the inserts, and then commit. In your specific environment, the database must be the last responsible to guarantee the ACID properties of the transaction, and never the JVM.
Jose Ramon Huerga
http://www.terra.es/personal/jrhuerga -
scalable Transactions for Web Applications for web applications[ Go to top ]
- Posted by: nitin dhawas
- Posted on: April 17 2010 07:55 EDT
- in response to Rajat M
Dear Sir,
I'm doing a ME project "Scalable Transactions for Web Applications in Cloud" I'm using the same concepts of scalable LTMs and TPS. Pls help me how to create scalable LTMs
Nitin Dhawas