jQuery in Action, 3rd edition
The moose likes Object Relational Mapping and the fly likes Hibernate and database data modifications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate and database data modifications" Watch "Hibernate and database data modifications" New topic

Hibernate and database data modifications

Andrei Antonescu
Ranch Hand

Joined: Jul 08, 2010
Posts: 75
Hello all,

I am currently working with Hibernate and Sql Server 2008. The question is if the webapp is running and I am modifying the data in the tables of the database (tables that Hibernate mapped to objects in my webapp) will that influence Hibernate in any way ?
Will it crash ?

Thanks in advance,
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Try it out and let us know if it crashes or not.
Bogdan Baraila
Ranch Hand

Joined: May 23, 2011
Posts: 43
IF you modify only the data hibernate will not crush but it's possible that your modified data to be overrwritten if same objects (rows) were loaded into you webapps. If you modify your database structure then it is possible to receive errors for the modified table (for example if you delete a table or a column mapped in hibernate; adding tables, columns etc. is ok).
Manuel Petermann
Ranch Hand

Joined: Jul 19, 2011
Posts: 177

I think it would be a a problem if you add a column with a not null constraint and try to add data to the table with hibernate though.

Please correct my English.
chris webster

Joined: Mar 01, 2009
Posts: 2295

Don't know much about Hibernate, but I suspect you might have problems with transaction locking or cached data if you're updating the DB in the background while your Hibernate application is running as well. You'd probably need to test the various scenarios to make sure things work the way you want/expect them to.

No more Blub for me, thank you, Vicar.
I agree. Here's the link: http://aspose.com/file-tools
subject: Hibernate and database data modifications
It's not a secret anymore!