I have a following problem.
I need to control when close a form verify the state of the transaction, to execute rollback or not. I notice that if I execute rollback several times and I need execute beginTransaction, the atomsframework say "nested begin transaction", then I don`t can opening a transaction and all change of the database doesn`t made.
I need know the state of transaction.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The transaction object is not exposed by the framework since the transaction class is different for each database provider.
Having said that, you can still tell if a transaction is running by using the IConnection.Started property. If the value is true then a transaction is running.
To get the Connection object you need to use ClassMap.RelationalDatabase.GetConnection.
I hope this helps.
- Richard.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a following problem.
I need to control when close a form verify the state of the transaction, to execute rollback or not. I notice that if I execute rollback several times and I need execute beginTransaction, the atomsframework say "nested begin transaction", then I don`t can opening a transaction and all change of the database doesn`t made.
I need know the state of transaction.
Hi Victor,
The transaction object is not exposed by the framework since the transaction class is different for each database provider.
Having said that, you can still tell if a transaction is running by using the IConnection.Started property. If the value is true then a transaction is running.
To get the Connection object you need to use ClassMap.RelationalDatabase.GetConnection.
I hope this helps.
- Richard.