Description:
I have developed a custom servlet that updates or inserts entries into a Translation Memory (TM).
Issue:
When two concurrent requests were made to the servlet, both attempting to update the same TM, one of the requests failed with the following error, halting execution:
com.idiominc.ws.sql.ConnectionLease: non SQLException caught in storage
com.idiominc.ws.storage.StorageResourceBusyException: A required SQL resource was unavailable. Please, retry the operation later.
Below are the lines of code responsible for updating the TM:WSTm tmToUpdate = wsContext.getTmManager().getTm(TmName);
The error specifically occurred at the insert operation (
tmToUpdate.insert(...)
).Environment:
- WorldServer Version: 11.7.3.328
Question:
- Is there a recommended way to handle concurrent inserts into the same TM to avoid this error?
- Does WorldServer provide any locking mechanisms or best practices for handling parallel TM updates?
Any insights or recommendations would be greatly appreciated.