Repository navigation
|
I'm working on a plugin currently and don't want to extend the DB to store some data, so I'm following the example on the metadata page. The above code is called by a scheduled task. The issue I'm having is if I check the metadata immediately after updating it it shows correctly, but on the next task run the metadata would be blank again. So looking at the mptt documentation I thought I might need to save the record (even though it's not in the example), this actually updates the part correctly, but I end up getting an error that the DB connection is closed. It looks like the connection is re-opened fine, but I'm not sure if I'm doing this correctly. |
Replies: 2 comments
|
Either do all database changes atomically or persist the iterator (it is lazy currently) |
|
Thanks for the help, for anyone else with a similar issue in the future, what worked for me was: |
Either do all database changes atomically or persist the iterator (it is lazy currently)