fix transaction calls
This commit is contained in:
parent
855add36cf
commit
19ab7d7231
@ -52,7 +52,7 @@ namespace test
|
|||||||
|
|
||||||
Console.Write("etl start:" + DateTime.Now.ToString());
|
Console.Write("etl start:" + DateTime.Now.ToString());
|
||||||
Console.Write(Environment.NewLine);
|
Console.Write(Environment.NewLine);
|
||||||
pgc.BeginTransaction();
|
NpgsqlTransaction pgt = pgc.BeginTransaction();
|
||||||
|
|
||||||
//--------------------------------------------move to target--------------------------------------------------------
|
//--------------------------------------------move to target--------------------------------------------------------
|
||||||
var ibmdr = ibmcmd.ExecuteReader();
|
var ibmdr = ibmcmd.ExecuteReader();
|
||||||
@ -140,11 +140,14 @@ namespace test
|
|||||||
Console.Write(Environment.NewLine);
|
Console.Write(Environment.NewLine);
|
||||||
Console.Write(e.Message);
|
Console.Write(e.Message);
|
||||||
ibmc.Close();
|
ibmc.Close();
|
||||||
|
pgt.Rollback();
|
||||||
pgc.Close();
|
pgc.Close();
|
||||||
|
|
||||||
}
|
}
|
||||||
sql = "";
|
sql = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pgt.Commit();
|
||||||
ibmc.Close();
|
ibmc.Close();
|
||||||
pgc.Close();
|
pgc.Close();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user