See below...

On Mon, 2009-09-07 at 12:20 +0300, Andrus wrote:
> using (TransactionScope tran = new TransactionScope())
>      using (var db = new MyDataContext())
> 
> but got compile error since TransactionScope does not exist.

TransactionScope is in the System.Transactions namespace (in
System.Transactions.dll), so you're probably missing a 'using'
declaration and an assembly reference.

That said, I'm not sure if DbLinq supports System.Transactions.  I
suspect it doesn't (though it will (eventually?) use DB transactions,
which may themselves support System.Transactions...snowballing into a
horrible I'm-not-sure-I-understand-the-end-result mess).

> Then I tried code from dblinq test
> 
> using (var db = new MyDataContext())
>    {
>     db.Connection.Open();
>     db.Transaction = db.Connection.BeginTransaction();
>     ... insert command to add document header
>     db.SubmitChanges();
>     int primarykey = mydoc.mykey;  // get autogenerated primary key value
>     ... insert and update commands which use primarykey to add document row
>     db.SubmitChanges();
>     db.Transaction.Commit();
>    }
> 
> but got runtime PostgreSql error telling that nested transactions are not 
> supported.
> 
> How to use transactions in DbLinq ?

Alas, I've been on hiatus for a month or two (sorry; was kidnapped for
MonoTouch hacking), but iirc DbLinq had some bugs in properly supporting
existing transactions (which I was intending to look into).  I'll try to
look at this shortly.

 - Jon



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DbLinq" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/dblinq?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to