Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

Record locking in postgresql

$
0
0
Hi,

I'm using Spring/Hibernate/GWT. In my DaoImpl I have metod getLockRecordForEdit() for that I'm using getHibernateTemplate().get(Object ... , LockMode.UPGRADE) but when I opened new web client I can edit, remove locked record why?
I checked in postgresql SELECT FOR UPDATE and when I wrote:
begin;
SELECT * .... FOR UPDATE;
record was lock because I didn't write COMMIT.
How to get and lock row from DB by spring/hibernate?
I suppose that I shouldn't use HibernateTemplate I should begin new session and transaction get record end when user finished edit record save end commit
sorry for my english.
Regards from Poland

Viewing all articles
Browse latest Browse all 297

Trending Articles