Ejemplo n.º 1
0
        public void Insert(ModelBase model)
        {
            try {
                Connection.Open();
                _transaction = Connection.BeginTransaction();

                LogTransaction(LogActions.Started);
                model.Insert(this);
                LogTransaction(LogActions.Confirmed, String.Empty);
            }
            catch (OracleException e) {
                _transaction.Rollback();
                LogTransaction(LogActions.Cancelled, String.Empty);
                throw e;
            }
            finally {
                if (Connection != null)
                {
                    Connection.Close();
                }

                _transaction = null;
            }
        }