I would like to set a time out on an operation of my published API so that the JVM thread is available for others again.
Some of our GET calls sometimes takes multiple seconds instead of the average 150ms, because of a delay in reads due to locking on a database cell.
We know that the consuming party has a timout of +-2 seconds, and then retrys it a bit later. Unfortunetaly, our thread connection stays occupied with the "wrong” call. This operation is called 300.000 times per hour, so we sometimes have all our JVM connections taken, while we know these are not usefull anymore because the consuming party is not (synchroniously) waiting anymore.
It would be great to have an option to cancel a thread/execution after X miliseconds, preferably with rollback behaviour.