Subject | Re: [IBO] Losing TIB_Connection whilst designing |
---|---|
Author | Helen Borrie |
Post date | 2003-02-20T10:44:27Z |
At 09:57 AM 20/02/2003 +0000, you wrote:
that a transaction can span multiple connections; and a connection can
have multiple transactions.
As a matter of style (for self-documentation and because I read and
sometimes mess with DFM files, e.g. to lift and merge their code for making
components) I prefer to always set down transactions explicitly and hook
statements to them explicitly.
You can just set down a single IB_Transaction and assign it to the
DefaultTransaction prop of the IB_Connection, then have your statements
follow the <default> trail to hook into that transaction.
If you want to do things BDE-style, you can even let the IB_Connection
create its own default transaction and link your statements to that via
<default>. Just don't come unstuck by setting down a transaction and then
hooking up all the statements to <default>. The transaction will do what
your code tells it to do, while the statements will be in a different
transaction - the internal one created by the ib_connection.
Stylistically, I prefer to use named objects because I like to be in
control of things. I recommended this course to you as a way to ensure
that you get the abstraction you think you are getting. But, from the
comments of Norm and Lester, it seems Builder sometimes has a problem
hanging on to properties...
Helen
>One query: Why do I have to set the connection for both theThere is no "have to" about the practice of naming objects. But remember
>transaction and the query? If a query's IB_Connection property is
>set to <default> does this use the transaction's connection?
that a transaction can span multiple connections; and a connection can
have multiple transactions.
As a matter of style (for self-documentation and because I read and
sometimes mess with DFM files, e.g. to lift and merge their code for making
components) I prefer to always set down transactions explicitly and hook
statements to them explicitly.
You can just set down a single IB_Transaction and assign it to the
DefaultTransaction prop of the IB_Connection, then have your statements
follow the <default> trail to hook into that transaction.
If you want to do things BDE-style, you can even let the IB_Connection
create its own default transaction and link your statements to that via
<default>. Just don't come unstuck by setting down a transaction and then
hooking up all the statements to <default>. The transaction will do what
your code tells it to do, while the statements will be in a different
transaction - the internal one created by the ib_connection.
Stylistically, I prefer to use named objects because I like to be in
control of things. I recommended this course to you as a way to ensure
that you get the abstraction you think you are getting. But, from the
comments of Norm and Lester, it seems Builder sometimes has a problem
hanging on to properties...
Helen