Skip to content

Commit

Permalink
Update .NET Data Provider を使用した DB の操作.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
MasayukiOzawa authored Oct 29, 2018
1 parent d02c22a commit f23481b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ $con2.ConnectionString = $constring

# オブジェクト生成後に Open し、try / catch でエラー時には、Complete しないようにする
try{
$transcope = New-Object System.Transactions.TransactionScope
$tranoption = New-Object System.Transactions.TransactionOptions
$tranoption.IsolationLevel = [System.Transactions.IsolationLevel]::ReadCommitted

$transcope = New-Object System.Transactions.TransactionScope -ArgumentList (New-Object System.Transactions.TransactionScopeOption)::Required, $tranoption

$con1.Open()

$cmd1 = $con1.CreateCommand()
Expand Down Expand Up @@ -223,4 +226,4 @@ While($ret.Read()){
$bw.Close()
$fs.Close()
}
$ret.Close()
$ret.Close()

0 comments on commit f23481b

Please sign in to comment.