main
1using gorilla.utility;
2
3namespace solidware.financials.service.orm
4{
5 public class DB4OUnitOfWork : UnitOfWork
6 {
7 readonly Connection connection;
8 readonly Context context;
9 bool was_committed;
10
11 public DB4OUnitOfWork(Connection connection, Context context)
12 {
13 this.connection = connection;
14 this.context = context;
15 }
16
17 public void commit()
18 {
19 connection.Commit();
20 was_committed = true;
21 }
22
23 public void Dispose()
24 {
25 context.remove(new TypedKey<Connection>());
26 if (!was_committed) connection.Rollback();
27 //connection.Dispose();
28 }
29 }
30}