Board index » delphi » Second Request

Second Request

Is this a stupid question or what?  I would really appreciate the favor of a
reply even if it is "I do not know."

Can someone please tell me why when TQuery.RequestLive:= true and the call
to DbiOpenBlob is made, another connection to the database is generated.  I
really need to find out why.  I have searched the newsgroups but to no
avail.  Maybe you can just point me in the right direction.

Debra Matela
Eastern Software Corp.

 

Re:Second Request


For one thing, you don't say what version of Delphi, or what database,
or how you're connecting, or why you're calling DbiOpenBlob.

John PIerce

Re:Second Request


How about setting a breakpoint in the source for TQuery so that you can
follow code execution to see what /really/ happens?

Eric

Quote
"Debra Matela" <debbi...@eastsoft.com> wrote in message

news:3bc5cc27$1_1@dnews...
Quote
> Is this a stupid question or what?  I would really appreciate the favor of
a
> reply even if it is "I do not know."

> Can someone please tell me why when TQuery.RequestLive:= true and the call
> to DbiOpenBlob is made, another connection to the database is generated.
I
> really need to find out why.  I have searched the newsgroups but to no
> avail.  Maybe you can just point me in the right direction.

> Debra Matela
> Eastern Software Corp.

Re:Second Request


Thank-you for your replies guys.  I was feeling like the ugly step sister.
But you are correct, I did not give enough info.

We are using Delphi 6 without the patches and I am testing on MSSQL 2000.
After logon to our application, I can see in Enterprise Manager, one
connection.  When I hit the button that runs the TQuery that has RequestLive
set to true, I trace all the way to the call to DbiOpenBlob in
TBDEDataSet.GetBlobFieldData, there is still one connection.  There is a
blob field in the result set.  I can't trace into DbiOpenBlob because it is
in BDE.pas.  The next thing I can trace is:

  1.   BdeCallBack with CallType: cbSERVERCALL then
  2.   TBDECallback.Invoke(cbSERVERCALL, $18fac70)
  3.   TSession.ServerCallBack($18fac70)  after this, there are two
connections.

From what I have learned, these callbacks are probably coming from
DbiOpenBlob and 1,2,3 above happens for each blob field that is opened
(retrieved).

When I trace using SQL Monitor, RequestLive = true, there are sql statements
executed that are calls to the sql system tables, and then a sql call:

SELECT DATALENGTH(blobfieldname) FROM tablename WHERE (clause from
application sql call)

for each blob field.  When RequestLive=false, these are not present.  When I
double click on the process in Enterprise Manager/Current Activity/Process
Info for the second new connection, it states:  READTEXT
<owner.tablename.columnname> and the database name is the same as the first
connection (Does this mean that it is just another connection and not
another database?).  The first connection, has the last query from our
application.  Is another database created or is just another connection when
RequestLive=true?  When Requestlive is true another connection to the
database is established, why and how (Is DbiOpenBlob doing this)?

I know that setting RequestLive=false will prevent the second connection but
I need to find out what is going on.  I would appreciate any replies,
thoughts, ideas.  I have combed the web and newsgroups for this info and
have had no success although I have seen requests for this info but not many
replies.

Debra Matela
Application Programmer
Eastern Software Corporation

Quote
"Eric Hill" <e...@ijack.net> wrote in message news:3bc5d5af$1_2@dnews...
> How about setting a breakpoint in the source for TQuery so that you can
> follow code execution to see what /really/ happens?

> Eric

> "Debra Matela" <debbi...@eastsoft.com> wrote in message
> news:3bc5cc27$1_1@dnews...
> > Is this a stupid question or what?  I would really appreciate the favor
of
> a
> > reply even if it is "I do not know."

> > Can someone please tell me why when TQuery.RequestLive:= true and the
call
> > to DbiOpenBlob is made, another connection to the database is generated.
> I
> > really need to find out why.  I have searched the newsgroups but to no
> > avail.  Maybe you can just point me in the right direction.

> > Debra Matela
> > Eastern Software Corp.

Re:Second Request


Good info.

Two things,

First, update to D6 SP1, and get the latest BDE (5.2?) from Borland's web
site and see if that helps.

Second, I seem to remember reading something about this in this ng many
moons ago.  You may do a search and see what you come up with.  Is there any
way you can test this with ADO instead of the BDE?  It may just be a BDE
"feature" that you're trying to work around...

Eric

Quote
"Debra Matela" <debbi...@eastsoft.com> wrote in message

news:3bc700c0_2@dnews...
Quote
> Thank-you for your replies guys.  I was feeling like the ugly step sister.
> But you are correct, I did not give enough info.

> We are using Delphi 6 without the patches and I am testing on MSSQL 2000.
> After logon to our application, I can see in Enterprise Manager, one
> connection.  When I hit the button that runs the TQuery that has
RequestLive
> set to true, I trace all the way to the call to DbiOpenBlob in
> TBDEDataSet.GetBlobFieldData, there is still one connection.  There is a
> blob field in the result set.  I can't trace into DbiOpenBlob because it
is
> in BDE.pas.  The next thing I can trace is:

>   1.   BdeCallBack with CallType: cbSERVERCALL then
>   2.   TBDECallback.Invoke(cbSERVERCALL, $18fac70)
>   3.   TSession.ServerCallBack($18fac70)  after this, there are two
> connections.

> From what I have learned, these callbacks are probably coming from
> DbiOpenBlob and 1,2,3 above happens for each blob field that is opened
> (retrieved).

> When I trace using SQL Monitor, RequestLive = true, there are sql
statements
> executed that are calls to the sql system tables, and then a sql call:

> SELECT DATALENGTH(blobfieldname) FROM tablename WHERE (clause from
> application sql call)

> for each blob field.  When RequestLive=false, these are not present.  When
I
> double click on the process in Enterprise Manager/Current Activity/Process
> Info for the second new connection, it states:  READTEXT
> <owner.tablename.columnname> and the database name is the same as the
first
> connection (Does this mean that it is just another connection and not
> another database?).  The first connection, has the last query from our
> application.  Is another database created or is just another connection
when
> RequestLive=true?  When Requestlive is true another connection to the
> database is established, why and how (Is DbiOpenBlob doing this)?

> I know that setting RequestLive=false will prevent the second connection
but
> I need to find out what is going on.  I would appreciate any replies,
> thoughts, ideas.  I have combed the web and newsgroups for this info and
> have had no success although I have seen requests for this info but not
many
> replies.

> Debra Matela
> Application Programmer
> Eastern Software Corporation

> "Eric Hill" <e...@ijack.net> wrote in message news:3bc5d5af$1_2@dnews...
> > How about setting a breakpoint in the source for TQuery so that you can
> > follow code execution to see what /really/ happens?

> > Eric

> > "Debra Matela" <debbi...@eastsoft.com> wrote in message
> > news:3bc5cc27$1_1@dnews...
> > > Is this a stupid question or what?  I would really appreciate the
favor
> of
> > a
> > > reply even if it is "I do not know."

> > > Can someone please tell me why when TQuery.RequestLive:= true and the
> call
> > > to DbiOpenBlob is made, another connection to the database is
generated.
> > I
> > > really need to find out why.  I have searched the newsgroups but to no
> > > avail.  Maybe you can just point me in the right direction.

> > > Debra Matela
> > > Eastern Software Corp.

Re:Second Request


I don't use the BDE anymore, and I don't use SqlServer either, but your
ugly-step-sister plight has touched me to the core.

The BDE treats "live" blobs and "dead" blobs differently.  The length
limit of dead blobs is set in the BDE and is limited to 1000000 bytes
(not 1mb), but live blobs will be retrieved in their entirety, and this
is why the BDE queries the database for the length.  I don't know why it
creates a separate connection, but I think it may do this specifically
for SqlServer (I use Oracle, and I don't think it did this back in the
days when I used the BDE).  It may have something to do with the way SS
serializes queries, and may be designed to avoid{*word*154} the blob query
pending the completion of something previous (just a guess).  In any
event, is there something undesirable about another connection?  In
Oracle, I'm always creating separate sessions for efficiency.

All the SS gurus on this forum recommend using ADO with SS, so I'll
pretend I know something about the subject and pass along the
recommendation to you.

By the way, in the most famous step-sister story of which I am aware,
the step-sister was the beautiful one :)

John Pierce

Other Threads