I have been writing a small banking application just so I could explore SQL and client server programming in
java.
Everything went well and the system performs perfectly when I sent one transaction at a time.
However when I wrote a small program to pump transactions at the server from different clients, I started to lose transactions.
I have hunted around for solutions but I am stuck. Any help would be appreciated as when I get over this problem I want to develop
a web interface to the database and then after that a mobile interface from a smart phone.
Anyway I have posted a cut down version of the database handling code called BackEnd.java and the program that pumps a user specified amount of transactions at the back end from the command line ........ e.g. "TestBank3 100" will send 50 transactions of $1 to account numbers 1 and 2.
If I send about 1000 transactions, most of the time none are lost. However send 200000 and then I lose about 10 of them.
I have played around with different values for Thread.sleep() and the ones in the code are the most reliable.
Here is the program that pumps the transactions.