I have a long running process (video rendering) in which occasional updates are made to the database to indicate the progress. However, how can I do this without locking the database for other processes. I tried to use the @NoTransaction annotation, but now there don’t seem to be any updates to the database.
Is there a way to, in such a long process, just create a transaction when needed?
I.e. search for the object and maintain it in a variable and then open a transaction, make the change, save it, and close the transaction so it is committed to the database. (there might be a need for a refresh in there, but that is fine).
Any suggestions? I can only find the Rollback feature in the Play! Documentation.
If you are using Play 1.2.4, please check the documentation on jobs. That should work for your task.
If you are using Play 2.0, you may want to check the Asynchronous programming part in here.