-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Locking table
PostPosted: Tue Dec 14, 2004 8:22 pm 
Beginner
Beginner

Joined: Wed Sep 15, 2004 3:14 am
Posts: 35
Hi

Is it possible to lock a table with Hibernate?

The scenario is that when I delete a record in the table, I need to update some fields of all the records in the same table. During the deleting/updating process, I don't want anyone to insert/update/delete data from this table but allow users to view data in the original state.

How can I implement this in Hibernate. I believe LockMode applies to object/record only and not table.

I am using PostreSQL and currently I use:

LOCK TABLE tbl_name IN ACCESS EXCLUSIVE MODE

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2004 2:44 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
call jdbc connection and use lock like now

regards


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2004 8:36 pm 
Beginner
Beginner

Joined: Wed Sep 15, 2004 3:14 am
Posts: 35
I am using that approach currently. I thought there was a better way to implement this using Hibernate, regardless of what database I use.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 15, 2004 10:25 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
It use rare and you can check database from JDBc DatabaseMetadata


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.