Hibernate ans SaveOrUpdate - ConstraintViolationException

Tuesday, August 5th, 2008

Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: could not insert

http://www.jroller.com/hasant/entry/hibernate_saveorupdate_trap_for_web

There is already an open DataReader associated with this Command which must be closed first

Saturday, August 2nd, 2008

I have been refactoring my code recently and pulling all of the table adapters on an older site into repositories ready to be ported accross to NHibernate. By doing this I now have static Table Adapters in the repositories. This was all fine on dev and uat but when it wen live this caused this error:

There is already an open DataReader associated with this Command which must be closed first.

This I suppose makes sense when there are many requests hitting the same table adapter at once now that it is static. To solve this problem I have added:

MultipleActiveResultSets=True

To the connection string. This does make sense but I am going to have to have a good think if having the table adapters as static properties in the repositories is a good thing - I suppose just getting in all ported to NHibernate would be a better idea!

This URL was handy!:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=123691&SiteID=1

Creating Virtual Machines

Friday, August 1st, 2008

This seems like an easy way to do it!:

http://www.easyvmx.com/