{"action":"opened","issue":{"number":166,"created_at":"2011-10-11T21:35:39Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I got this error after I transferred the contents of a resource to another and then tried to delete the resource that from which the transferred contents came from. \r\n\r\nThis is the error:\r\n\r\norg.hibernate.exception.ConstraintViolationException: could not delete: [org.archiviststoolkit.model.Resources#2]\r\n\tat org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)\r\n\tat org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)\r\n\tat org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2569)\r\n\tat org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2725)\r\n\tat org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:97)\r\n\tat org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)\r\n\tat org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)\r\n\tat org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:172)\r\n\tat org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)\r\n\tat org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)\r\n\tat org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)\r\n\tat org.archiviststoolkit.mydomain.ResourcesDAO.deleteResource(ResourcesDAO.java:312)\r\n\tat org.archiviststoolkit.mydomain.ResourcesDAO.deleteGroup(ResourcesDAO.java:247)\r\n\tat org.archiviststoolkit.mydomain.DomainTableWorkSurface$5.run(DomainTableWorkSurface.java:885)\r\n\tat java.lang.Thread.run(Unknown Source)\r\nCaused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row: a foreign key constraint fails (`atreference2_5_3`.`patronvisitsresources`, CONSTRAINT `FKAAE25A2F53ACD5C3` FOREIGN KEY (`resourceId`) REFERENCES `resources` (`resourceId`))\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)\r\n\tat java.lang.reflect.Constructor.newInstance(Unknown Source)\r\n\tat com.mysql.jdbc.Util.handleNewInstance(Util.java:409)\r\n\tat com.mysql.jdbc.Util.getInstance(Util.java:384)\r\n\tat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1041)\r\n\tat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)\r\n\tat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)\r\n\tat com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)\r\n\tat com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)\r\n\tat com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2568)\r\n\tat com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2113)\r\n\tat com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2409)\r\n\tat com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2327)\r\n\tat com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2312)\r\n\tat org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2551)\r\n\t... 12 more\r\n","comments":0,"title":"Error when deleting a resource that is linked to a patron visit","updated_at":"2011-10-11T21:35:39Z","url":"https://api.github.com/repos/RockefellerArchiveCenter/ATReference/issues/166","id":1881246,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/ddf08eb416ec6c038f33711fd6c11f18?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/StevensBrian","id":380685,"login":"StevensBrian"},"html_url":"https://github.com/RockefellerArchiveCenter/ATReference/issues/166","labels":[{"name":"Lee","url":"https://api.github.com/repos/RockefellerArchiveCenter/ATReference/labels/Lee","color":"9e0ef2"},{"name":"Nathan","url":"https://api.github.com/repos/RockefellerArchiveCenter/ATReference/labels/Nathan","color":"02e10c"}],"state":"open"},"legacy":{"number":166,"action":"opened","issue":1881246}}