Session does not giving right records?
- by Jugal
I want to keep one session, but when I rollback transaction then transaction gets isActive=false, so I can not commit and rollback in next statements by using same transaction. then I need to create new transaction but what is going wrong here ?
var session = NHibernateHelper.OpenSession();/* It returns new session. */
var transaction1 = session.BeginTransaction();
var list1 = session.Query<Make>().ToList(); /* It returs 4 records. */
session.Delete(list1[2]);
/* After Rollback, transaction is isActive=false so I can not commit
* and rollback from this transaction in future. so I need to create new transaction.
*/
transaction1.Rollback();
var transaction2 = session.BeginTransaction();
/* It returns 3 records.
* I am not getting object(which was deleted but after that rollback) here why ?
*/
var list2 = session.Query<Make>().ToList();
Anyone have idea what is going wrong here ? I am not getting deleted object which was rollback.