Author Topic: Opinions on using ObjectID's verses actual Objects...  (Read 2318 times)

0 Members and 1 Guest are viewing this topic.

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Opinions on using ObjectID's verses actual Objects...
« on: January 17, 2007, 01:34:45 PM »
This topic is important enough to me to start a new thread, even though previous threads have hit on it.
I am wondering if its a safe practice to do things like this:

Function 1
  Open transaction
    Get an Object like a line
  Close transaction
  Return object
End function

later on...
use object props (but do not modify object)

As I understand it, I can open an object for read-only and do whatever I want.  No need to worry about a transaction.  Seems to work very well so far for all kinds of objects.

If I want to modify something, I must do that within a transaction.  I cannot simply change a property and have it take effect somehow.  I do remember a method to "upgrade" to writeable status, but I am guessing that must be done in a transaction also.

This issue heavily affects how I structure my library of subroutines.  Do I return ObjectID's or the actual object for the functions?  that is the question this will answer.
I need to be sure I get started on the right foot.
James Maeding

Chuck Gabriel

  • Guest
Re: Opinions on using ObjectID's verses actual Objects...
« Reply #1 on: January 17, 2007, 03:06:44 PM »
This is just an educated guess, but I think it will probably be safer to return an ObjectId.

Glenn R

  • Guest
Re: Opinions on using ObjectID's verses actual Objects...
« Reply #2 on: January 17, 2007, 10:28:21 PM »
Totally agree with Chuck on this one.

Cheers,
Glenn.

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: Opinions on using ObjectID's verses actual Objects...
« Reply #3 on: January 19, 2007, 12:08:34 PM »
That makes sense to me too, but the consequence is you will be doing transactions all over the place.
That is fine too I guess as speed is generally not a problem, its stability that is most important.
Any speed sensitive stuff could be written without subbing too much out to keep the transactions down.
This is coming along, thanks everyone
James Maeding