Subject Re: [IB-Architect] New API: Object Life Time
Author Jason Wharton
With regard to object lifetime I suggest that you look at two aspects of it.

#1: Container object lifetime
#2: Resource allocation lifetime

I have not followed all the messages in this thread closely so I may not
even be on target... but I just wanted to make sure that there wasn't a 1:1
relationship between the object designed to wrap a resource allocation and
the handle obtained for that resource. I'm probably going to explain
something that most others just assume...

For example, if you grab a transaction handle it is wise to have an
algorithm that allows the transaction handle to be committed (even if there
are no changes pending) so that garbage collection will be able to take
place. A stuck transaction can ultimately kill the server.

So, dependant objects will reference count their relationship to the
container that holds the transaction handle and also reference count the
need for the handle itself. This way if there is no need for the handle but
the transaction relationship still exists the handle can be freed without
having to free the container object.

I hope my jargon makes sense in this context. If not feel free to pry.

PS. I really wish I had time to participate in this forum more...

PSS. I'm still stewing on the events thing too...

FWIW,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com