TheSwamp

Code Red => .NET => Topic started by: Viktor on October 30, 2008, 12:40:02 PM

Title: Properly opening DWG Database
Post by: Viktor on October 30, 2008, 12:40:02 PM
I notice that there are a few different ways to access objects in dwg database so I thought I'd ask what is the difference?

Some use the following approach:

tr.getobject(objid,openforread)

and some use

objid.getobject(openforread)

Both are preceeded by db.transactionmanager.starttransaction

and

Both use tr.commit when done.

Are there problems with one over the other? do transactions work different in the above scenarios?

Thanks,
Viktor.
Title: Re: Properly opening DWG Database
Post by: sinc on October 30, 2008, 12:47:18 PM
The only difference is that ObjectId.GetObject() implicitly uses the top-level transaction, whereas with tr.GetObject(), you are specifying the transaction explicitly.