TimeoutException:

in Help Center
Hi, all.
We deploy our Java application to ice grid node, and use PHP as ice client to call on proxy object's method to perform a transaction, for example, submit an order.
At PHP client site, we set the ice_timeout to 20000 ms, when Java proforms a long_time transaction or the database is locked by another process(we use SELECT FOR UPDATE statement to acquire to lock on a record), and the TimeoutException may be throwed, client user can see the transaction fail message.
But at server side, the Java program will continue to perform the transaction and submit it to database at last.
Will anybody know how to resolve this problem?
It seems that C/S program(for example, PHP as Client and Java as Server) can not avoid this problem. But B/S program can avoid it, when a transaction timeout(or wait for lock timeout at mysql), client user can see error message, and nothing is submited to database.
We deploy our Java application to ice grid node, and use PHP as ice client to call on proxy object's method to perform a transaction, for example, submit an order.
At PHP client site, we set the ice_timeout to 20000 ms, when Java proforms a long_time transaction or the database is locked by another process(we use SELECT FOR UPDATE statement to acquire to lock on a record), and the TimeoutException may be throwed, client user can see the transaction fail message.
But at server side, the Java program will continue to perform the transaction and submit it to database at last.
Will anybody know how to resolve this problem?
It seems that C/S program(for example, PHP as Client and Java as Server) can not avoid this problem. But B/S program can avoid it, when a transaction timeout(or wait for lock timeout at mysql), client user can see error message, and nothing is submited to database.
0
Comments
As far as I can see, your problem is caused by setting the timeout on the client side only, so the user ends up with error information that doesn't correspond with reality.
The thing to do would be to set a timeout on the server side and, if the transaction on the server side times out, throw a TransactionTimeoutException or some such that is propagated back to the client.
Cheers,
Michi.
I only set timeout at client site.
How to set ice timeout at server side? When ice timeout at server side? And when timeout occurs, will the transaction roll back?
What you should do is either find a way to have the server's transaction with the database time out if it takes too long or, failing that, not set a timeout for the client.
As is, things cannot possibly work because the timeout on the client side tells the client a story that is not true.
Cheers,
Michi.
Now I know how to resolve such problem: