SCM

[#1010469] Transaction-Object not assign not throws an error

View Trackers | Bugs | Download .csv | Monitor

Date:
2008-09-11 05:42
Priority:
3
State:
Open
Submitted by:
Christian Holzner (christianh)
Assigned to:
Nobody (None)
Npgsql Version:
2.0rc1
Category:
Group:
Resolution:
None
Summary:
Transaction-Object not assign not throws an error

Detailed description
When I start a transaction-block al the commands, executed in the block should have assigned the Transaction, otherwise an error should occur. Npgsql is not throwing a error. This is not a problem for me, but I think it should work like all other Dataproviders.

This example not throws an error:

Dim cn As Npgsql.NpgsqlConnection
Dim tr As Npgsql.NpgsqlTransaction
Try
cn = New Npgsql.NpgsqlConnection("...")
cn.Open()

tr = cn.BeginTransaction

Dim cmd As Npgsql.NpgsqlCommand = cn.CreateCommand
'cmd.Transaction = tr
cmd.CommandText = "select * from ..."
cmd.ExecuteNonQuery()

tr.Commit()
Catch ex As Exception
Debug.WriteLine(ex.Message)
tr.Rollback()
Finally
cn.Close()
End Try

Followup

Message
Date: 2008-10-05 17:48
Sender: Francisco Figueiredo jr.


I agree with Josh.
Date: 2008-09-14 18:45
Sender: Josh Cooley

I was not aware even most providers required setting the Transaction property on the command.

I believe the error would break too many applications for us to change that behavior. Unless there's a problem caused by allowing this to work, I'm not sure it's worth the change.

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge