Announcement Announcement Module
Collapse
No announcement yet.
Record locking in postgresql Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Record locking in postgresql

    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
Working...
X