You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to clean up resources associated with a Session, the Session must be closed. Some applications will perform just one action and regardless of the outcome, clean up the Session.
With either the callback model or promises model, there is extra work to do to close the Session.
This proposal adds a function to Session. Session.oneShot() will set the Session into a mode where it will be closed after executing a single function. When the promise is fulfilled or the callback is called, the Session is no longer usable.
The text was updated successfully, but these errors were encountered:
Some thoughts:
What is the return from oneShot()?
What if a transaction is currently open?
In oneShot, Is it possible to create a batch and execute it?
How about:
oneShot() returns the session so it can be chained. session.oneShot().find(...)
if a transaction is open, the next operation commits if successful and rolls back if not, then closes.
createBatch() does not trigger the behavior, but batch.execute() will close the session afterward.
Same for createQuery() and query.execute(), yes?
Good catch. Yes. createQuery() would not trigger the behavior but query.execute() would execute and then close the session.
In order to clean up resources associated with a Session, the Session must be closed. Some applications will perform just one action and regardless of the outcome, clean up the Session.
With either the callback model or promises model, there is extra work to do to close the Session.
This proposal adds a function to Session. Session.oneShot() will set the Session into a mode where it will be closed after executing a single function. When the promise is fulfilled or the callback is called, the Session is no longer usable.
The text was updated successfully, but these errors were encountered: