{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/ddf08eb416ec6c038f33711fd6c11f18?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"ddf08eb416ec6c038f33711fd6c11f18","url":"https://api.github.com/users/StevensBrian","login":"StevensBrian","id":380685},"milestone":null,"assignee":{"avatar_url":"https://secure.gravatar.com/avatar/fabde2bb7ae00814e11a8b2499fe6e7e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"fabde2bb7ae00814e11a8b2499fe6e7e","url":"https://api.github.com/users/ns96","login":"ns96","id":835756},"labels":[{"name":"1.0","color":"02d7e1","url":"https://api.github.com/repos/RockefellerArchiveCenter/ATReference/labels/1.0"},{"name":"Lee","color":"9e0ef2","url":"https://api.github.com/repos/RockefellerArchiveCenter/ATReference/labels/Lee"},{"name":"Nathan","color":"02e10c","url":"https://api.github.com/repos/RockefellerArchiveCenter/ATReference/labels/Nathan"}],"updated_at":"2011-11-04T15:05:07Z","closed_at":null,"comments":7,"url":"https://api.github.com/repos/RockefellerArchiveCenter/ATReference/issues/166","body":"I got this error after I transferred the contents of a resource to another and then tried to delete the resource from which the transferred contents came. \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","html_url":"https://github.com/RockefellerArchiveCenter/ATReference/issues/166","title":"Error when deleting a resource that is linked to a patron visit","number":166,"id":1881246,"created_at":"2011-10-11T21:35:39Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/fabde2bb7ae00814e11a8b2499fe6e7e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"fabde2bb7ae00814e11a8b2499fe6e7e","url":"https://api.github.com/users/ns96","login":"ns96","id":835756},"updated_at":"2011-11-04T15:05:07Z","url":"https://api.github.com/repos/RockefellerArchiveCenter/ATReference/issues/comments/2631923","body":"Based on the screenshot provided by Laura, the message that is  \ndisplayed to user is the \"fixed\" one.  In prior versions, the user  \nwould be presented with some incomprehensible error message, now they  \nget a message that should make it clear what the problem is.  The  \nwording of the message can of course be modified if it's not clear  \nenough.\n\n\n\n\nOn Nov 3, 2011, at 11:55 AM, beckyrobbins wrote:\n\n> Tested unsuccessfully in 1.0.1\n>\n> ---\n> Reply to this email directly or view it on GitHub:\n> https://github.com/RockefellerArchiveCenter/ATReference/issues/ \n> 166#issuecomment-2618872\n\nNathan Stevens\nProgrammer/Analyst\nDigital Library Technology Services\nNew York University\n1212-998-2653\nns96@nyu.edu","id":2631923,"created_at":"2011-11-04T15:05:07Z"}}