"faisal"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it
here.
Just add your last name to your profile.
Also you posted your question in the
Servlets forum. Your question isn't really about Servlets at all, it is really a
Java in General type question. I am going to move this
thread to that forum.
But, for an answer, a Synchronized method only allows one caller at a time to call the method, so if two calls are made at the same time, one of the calls will have to wait for the other to finish first.
Now a transaction is an atomic process. Meaning all the code within the transaction completes, or none of it is allowed to complete. In the database world, say you are adding three new records within this transaction, if any one of those records fail to add, then none of the three records are added.
Thanks! and welcome to the JavaRanch!
Mark