Hi,
I am not sure how to work with transactions correctly
This is a working piece of code:
IDaoManager DaoManager = ...
...
IDalSession dalSession = DaoManager.BeginTransaction();
DaoManager.CommitTransaction();
dalSession = DaoManager.BeginTransaction();
I thought this:
IDalSession dalSession = DaoManager.BeginTransaction();
dalSession.CommitTransaction();
dalSession = DaoManager.BeginTransaction();
But it throws DataAccessException: "DaoManager could not invoke BeginTransaction(). A DaoSession is already started. Call CommitTransaction() or RollbackTransaction first."
What is the difference between the two pieces? Is there a way to correctly commit when holding IDalSession and not DaoManager?
Also, what is the difference between IDalSession.Complete and IDalSession.CommitTransaction?