{"action":"opened","issue":{"url":"https://api.github.com/repos/ebean-orm/ebean/issues/805","repository_url":"https://api.github.com/repos/ebean-orm/ebean","labels_url":"https://api.github.com/repos/ebean-orm/ebean/issues/805/labels{/name}","comments_url":"https://api.github.com/repos/ebean-orm/ebean/issues/805/comments","events_url":"https://api.github.com/repos/ebean-orm/ebean/issues/805/events","html_url":"https://github.com/ebean-orm/ebean/issues/805","id":169346116,"number":805,"title":"ENH: Add BeanState.resetForInsert() ... This resets bean state such that a save() results in an insert","user":{"login":"rbygrave","id":208973,"avatar_url":"https://avatars.githubusercontent.com/u/208973?v=3","gravatar_id":"","url":"https://api.github.com/users/rbygrave","html_url":"https://github.com/rbygrave","followers_url":"https://api.github.com/users/rbygrave/followers","following_url":"https://api.github.com/users/rbygrave/following{/other_user}","gists_url":"https://api.github.com/users/rbygrave/gists{/gist_id}","starred_url":"https://api.github.com/users/rbygrave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbygrave/subscriptions","organizations_url":"https://api.github.com/users/rbygrave/orgs","repos_url":"https://api.github.com/users/rbygrave/repos","events_url":"https://api.github.com/users/rbygrave/events{/privacy}","received_events_url":"https://api.github.com/users/rbygrave/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ebean-orm/ebean/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"rbygrave","id":208973,"avatar_url":"https://avatars.githubusercontent.com/u/208973?v=3","gravatar_id":"","url":"https://api.github.com/users/rbygrave","html_url":"https://github.com/rbygrave","followers_url":"https://api.github.com/users/rbygrave/followers","following_url":"https://api.github.com/users/rbygrave/following{/other_user}","gists_url":"https://api.github.com/users/rbygrave/gists{/gist_id}","starred_url":"https://api.github.com/users/rbygrave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbygrave/subscriptions","organizations_url":"https://api.github.com/users/rbygrave/orgs","repos_url":"https://api.github.com/users/rbygrave/repos","events_url":"https://api.github.com/users/rbygrave/events{/privacy}","received_events_url":"https://api.github.com/users/rbygrave/received_events","type":"User","site_admin":false},"assignees":[{"login":"rbygrave","id":208973,"avatar_url":"https://avatars.githubusercontent.com/u/208973?v=3","gravatar_id":"","url":"https://api.github.com/users/rbygrave","html_url":"https://github.com/rbygrave","followers_url":"https://api.github.com/users/rbygrave/followers","following_url":"https://api.github.com/users/rbygrave/following{/other_user}","gists_url":"https://api.github.com/users/rbygrave/gists{/gist_id}","starred_url":"https://api.github.com/users/rbygrave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbygrave/subscriptions","organizations_url":"https://api.github.com/users/rbygrave/orgs","repos_url":"https://api.github.com/users/rbygrave/repos","events_url":"https://api.github.com/users/rbygrave/events{/privacy}","received_events_url":"https://api.github.com/users/rbygrave/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ebean-orm/ebean/milestones/111","html_url":"https://github.com/ebean-orm/ebean/milestones/8.2.1","labels_url":"https://api.github.com/repos/ebean-orm/ebean/milestones/111/labels","id":1922823,"number":111,"title":"8.2.1","description":null,"creator":{"login":"rbygrave","id":208973,"avatar_url":"https://avatars.githubusercontent.com/u/208973?v=3","gravatar_id":"","url":"https://api.github.com/users/rbygrave","html_url":"https://github.com/rbygrave","followers_url":"https://api.github.com/users/rbygrave/followers","following_url":"https://api.github.com/users/rbygrave/following{/other_user}","gists_url":"https://api.github.com/users/rbygrave/gists{/gist_id}","starred_url":"https://api.github.com/users/rbygrave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbygrave/subscriptions","organizations_url":"https://api.github.com/users/rbygrave/orgs","repos_url":"https://api.github.com/users/rbygrave/repos","events_url":"https://api.github.com/users/rbygrave/events{/privacy}","received_events_url":"https://api.github.com/users/rbygrave/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":4,"state":"open","created_at":"2016-08-04T04:42:10Z","updated_at":"2016-08-04T10:48:08Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-08-04T10:48:08Z","updated_at":"2016-08-04T10:48:08Z","closed_at":null,"body":"Add `BeanState.resetForInsert()` ... This resets bean state such that a save() results in an insert\r\n\r\n### Steps to reproduce\r\n\r\n```java\r\n    try {\r\n      // insert of bean succeeds but fails in cascaded statements\r\n      bean.save();\r\n\r\n    } catch (PersistenceException e) {\r\n\r\n      Ebean.getBeanState(b).resetForInsert();\r\n      \r\n      // results in an insert\r\n      bean.save();\r\n    }\r\n```\r\n\r\nThis change improves the rollback handling and logging in this case."}}
{"actor":{"display_login":"rbygrave"}}