I can confirm this strange behavior. it is not related to OpenAccess and you can simulate it even in the SQL Server Management Studio if you try to execute your stored procedure. It should give you the same error.
I tested with the following stored procedure and it works:
@Result = sys.sp_getapplock
@LockTimeout = 2000
'Unable to aquire lock'
@Result = sys.sp_releaseapplock
It seems that there is something to do with the resource name = WorkAllocator
. When try with this value you will see that the sys.sp_getapplock
stored procedure will report result value -1
which means 'The lock request timed out.'
This could happen if there is such lock already.
If you use different key it works. This could be related to the lock retrieval/storage mechanism. Sql Server hashes the resource value and store it.
To troubleshoot the issue you could find the system table holding the lock objects and try to found out who has created it.
I hope this helps.
OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.