Jakub Trllo Posted June 28, 2019 Report Share Posted June 28, 2019 Hi, I've probably found a `bug` in ftrack_api, When I'm creating multiple notes on entity it works correctly but when a reply on one of those notes is added then on next following note commit session crashes. Example code: task = session.query('Task').first() user = session.query('User').first() # This will work as expected task.create_note('Note 1', user) session.commit() task.create_note('Note 2', user) session.commit() # This will crash note3 = task.create_note('Note 3', user) session.commit() note3.create_reply('Reply 1', user) session.commit() task.create_note('Note 4', user) session.commit() # On this line Reason is missing recipient. I've tried to create it manually but I didn't found out what `resource_id` represents. I need it working ASAP, please help. Thanks! Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted July 2, 2019 Report Share Posted July 2, 2019 Hi @Jakub Trllo, look like you hit a genuine bug there ! Thanks for reporting, we will soon start looking into it. For now though you can use this workaround (see the session.reset() before the last commit) task = session.query('Task').first() user = session.query('User').first() # This will work as expected task.create_note('Note 1', user) session.commit() task.create_note('Note 2', user) session.commit() note3 = task.create_note('Note 3', user) session.commit() note3.create_reply('Reply 1', user) session.commit() task.create_note('Note 4', user) # here is the fix session.reset() # reset the session session.commit() # On this line Hope it helps! L. Link to comment Share on other sites More sharing options...
Jakub Trllo Posted July 3, 2019 Author Report Share Posted July 3, 2019 Hi @Lorenzo Angeli, reset helped out . I'm a little bit afraid that something bad will happen when 100 replies will be added at once... Thanks! Jakub Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted July 3, 2019 Report Share Posted July 3, 2019 Hi @Jakub Trllo the only thing which might be happening is a bit of slowdown, but this won't impact the robustness of the overall system. If there's any doubt let us know. Cheers. L. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now