-->
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.  [ 6 posts ] 
Author Message
 Post subject: Read only mode for Hibernate
PostPosted: Fri Sep 03, 2004 2:04 pm 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
Hibernate 2.1.6

Given the ease with which Hibernate will let you modify data, is there a way to put Hibernate in to read only mode? (For initial development/testing against production data)?

I know I could solve this problem using readonly credentials at the DB level, but this involves our DBAs - not a big deal, but Im looking for an application level hook.

Nick


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 03, 2004 2:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
write an Interceptor


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 03, 2004 2:08 pm 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
Thanks Gavin.

So no hibernate properties flag. Would it be worth adding one?


Nick


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 03, 2004 7:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
um, it doesn't look like a very common requirement....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 04, 2004 5:25 pm 
Proxool Developer
Proxool Developer

Joined: Tue Aug 26, 2003 10:42 am
Posts: 373
Location: Belgium
gavin wrote:
um, it doesn't look like a very common requirement....


And what about session.setFlushMode(FlushMode.NEVER); when the session is opened and never calling flush() ?

This way Hibernate shouldn't commit anything to the database, right ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 04, 2004 7:42 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Actually, that's not absolutely foolproof; someone might call flush() manually. Also, if you are using identity columns, INSERTs happen immediately and don't wait for the flush.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.