Take the 2-minute tour ×

I want to leverage get_lock() function of mysql as a global lock, but it looks like impossible as I also use JPA as my database layer. Because get_lock() is connection based that means you have to lock/unlock using the same connection, however, there is no native way to retrieve a JDBC connection from JPA. Does that mean get_lock()/release_lock() is totally impossible in JPA? I don't like unwrap to underlying JPA implementation as it's not portable.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I finally solved this issue by using a JDBC datasource as well as JPA

share|improve this answer
add comment

Your Answer


