Author Topic: Properly opening DWG Database  (Read 1701 times)

0 Members and 1 Guest are viewing this topic.

Viktor

  • Guest
Properly opening DWG Database
« 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.

sinc

  • Guest
Re: Properly opening DWG Database
« Reply #1 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.