You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Tobias Hilka <th...@vps.de> on 2008/02/19 15:34:40 UTC

Timeout for a Torque call

Hello,

 

is there any possibility within Torque to define some kind of timeout for a
single Torque action like saving a record to database?

 

We have the problem that we want to interrupt a call to a database which
sometimes does not respond within a reasonable time.

 

Any ideas on this?

 

Tobias Hilka

 

 


Antwort: Timeout for a Torque call

Posted by Thomas Fischer <fi...@seitenbau.net>.
"Tobias Hilka" <th...@vps.de> schrieb am 19.02.2008 15:34:40:

> Hello,
>
> is there any possibility within Torque to define some kind of timeout for
a
> single Torque action like saving a record to database?
>
> We have the problem that we want to interrupt a call to a database which
> sometimes does not respond within a reasonable time.
>
> Any ideas on this?

None that I know of within Torque. I can think of two possibilities:
1) maybe the jdbc driver for the particular database you are using is
offering such a feature
2) You can create a new thread and do the save() in the new thread.
However, this brings additional problems such as
  - To be sure that the save is not completed if you run into the timeout
you must add some transaction-handling code
  - the code must be thread-safe

      Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org