Subject | How are IB_Session instances managed? |
---|---|
Author | Nando Dessena |
Post date | 2004-01-04T22:45:48Z |
Hello,
I have just spent an inordinate amount of time just to make a simple demo
program work. Its particularity was that I had two IB_Session
components on a form and wanted to link a IB_Connection,
IB_Transaction and live IBODataSet triple to each of them. No way.
This is certainly due to my utter ignorance of how IBO manages
references to IB_Sessions, at least I hope so because ignorance can be
cured more easily than bad software. :-)
Can someone confirm the following findings?
1- The IB_Session property of IB_Connection and IB_Transaction can only
be set by code, not at design time.
2- The IB_Session of IBODataSet is read-only.
InternalDataSet.IB_Session can be set by code, but internal
IB_Statement objects created for fetches, lookups, etc. invariably get
bound to a "default" IB_Session, thus defeating the assignment and
generating all kinds of interesting effects.
3- Once a IB_Session component is put on a form, it becomes the
"default" session for all IB_Components on that form. All other
IB_Session components are ignored unless I use them in code, which
takes me back to point 2.
4- The components apparently don't check session coherence. IOW, I can
have the usual IB_Connection, IB_Transaction and IB_Query bunch, link
them together and link each of these to a different IB_Session without
getting errors until late in the form of strange effects, assertions
and AVs in the client library.
Does anyone care to explain in what exactly does IBO's IB_Session
management differ from the old BDE TSession thing, or point me to the
appropriate documentation? I have looked in the help file and studied
the source, but I might have missed something. If there's nothing I
have missed and things actually work like I observed then I think it's
flawed or at least not flexible enough - I think it is reasonable to
expect to not have to rely on component ownership to distribute data
access components across sessions.
Sorry for the long post.
Ciao
--
Nando mailto:nandod@...
I have just spent an inordinate amount of time just to make a simple demo
program work. Its particularity was that I had two IB_Session
components on a form and wanted to link a IB_Connection,
IB_Transaction and live IBODataSet triple to each of them. No way.
This is certainly due to my utter ignorance of how IBO manages
references to IB_Sessions, at least I hope so because ignorance can be
cured more easily than bad software. :-)
Can someone confirm the following findings?
1- The IB_Session property of IB_Connection and IB_Transaction can only
be set by code, not at design time.
2- The IB_Session of IBODataSet is read-only.
InternalDataSet.IB_Session can be set by code, but internal
IB_Statement objects created for fetches, lookups, etc. invariably get
bound to a "default" IB_Session, thus defeating the assignment and
generating all kinds of interesting effects.
3- Once a IB_Session component is put on a form, it becomes the
"default" session for all IB_Components on that form. All other
IB_Session components are ignored unless I use them in code, which
takes me back to point 2.
4- The components apparently don't check session coherence. IOW, I can
have the usual IB_Connection, IB_Transaction and IB_Query bunch, link
them together and link each of these to a different IB_Session without
getting errors until late in the form of strange effects, assertions
and AVs in the client library.
Does anyone care to explain in what exactly does IBO's IB_Session
management differ from the old BDE TSession thing, or point me to the
appropriate documentation? I have looked in the help file and studied
the source, but I might have missed something. If there's nothing I
have missed and things actually work like I observed then I think it's
flawed or at least not flexible enough - I think it is reasonable to
expect to not have to rely on component ownership to distribute data
access components across sessions.
Sorry for the long post.
Ciao
--
Nando mailto:nandod@...