Delphi, BDE and DB2 
Author Message
 Delphi, BDE and DB2

I realize that there are probably not alot of Delphi people around
here, but unfortunatly there are not alot of DB2 on the Delphi news
groups.

I have this problem where I delphi table component attempts an update
to a particular record in my DB2 UDB 7.1 on Win2000. Although I cant
see the specific CLI call the UPDATE SQL that gets passed is correct.

The problem is that DB2 returns "Rows Affected = -1" even though the
update occurs correctly. The new value gets stored in the database.
The BDE identifies this as a lock contention problem an returns a
'Record has been modified by another user error' which is simply not
the case. No other users or applications are accessing the database.

I am wondering if it there is a configuration parameter(s) that needs
to be set.

Any help would be appreciated.

Jeff Bendixsen



Tue, 29 Apr 2003 03:00:00 GMT
 Delphi, BDE and DB2


Quote:
> I realize that there are probably not alot of Delphi people around
> here, but unfortunatly there are not alot of DB2 on the Delphi news
> groups.

> I have this problem where I delphi table component attempts an update
> to a particular record in my DB2 UDB 7.1 on Win2000. Although I cant
> see the specific CLI call the UPDATE SQL that gets passed is correct.

> The problem is that DB2 returns "Rows Affected = -1" even though the
> update occurs correctly. The new value gets stored in the database.
> The BDE identifies this as a lock contention problem an returns a
> 'Record has been modified by another user error' which is simply not
> the case. No other users or applications are accessing the database.

> I am wondering if it there is a configuration parameter(s) that needs
> to be set.

> Any help would be appreciated.

> Jeff Bendixsen

Hi,

To get more information you can activate a CLI trace. It will show you
the executed SQL and the returned SQL code etc.

Copied from the Troubleshooting Guide:

===== Start copy =====
The CLI trace can be used for any CLI, ODBC, or JDBC application that
connects to DB2 using the CLI Driver.

To turn on this trace facility, set the db2cli.ini keyword option TRACE
on (1). CLI trace records are appended to the file specified by the
TRACEFILENAME keyword, or placed in the directory specified by the
TRACEPATHNAME keyword.

For example, to set up a CLI trace file that is written to disk after
each trace entry, include the following lines in the common section of
the initialization file (DB2CLI.INI).

[COMMON]
TRACE=1
TRACEFILENAME=E:\TRACES\CLI\MONDAY.CLI
TRACEFLUSH=1
===== End copy =====

Hope this helps.



Tue, 29 Apr 2003 03:00:00 GMT
 Delphi, BDE and DB2
Hi !

I've got some experience with delphi and sql databases, though not with
DB/2.
one thing i always noted was, that table components don't work particulary
well
with SQL based databases, creating an equivalent query component and making

it updateable is definitely the recommended way. i would also suggest
playing around
with BDE parameters concerning transaction isolation level. there is some
info about that
in the bde32 help files, some of it even db2 specific.

i hope i could help.

Stefan Marte
---



Thu, 01 May 2003 03:00:00 GMT
 Delphi, BDE and DB2
On Sun, 12 Nov 2000 19:57:12 +0100, Stefan Marte

I have tried using a TQuery component with request.live = true as a
replacement for the TTable. The Query will generate the same problem
and be slower (due to many more BDE calls and less optimized fetches).
It is for speed reasons that we use the table, in this case we are
only dealing with 1 table that doesnt get very big ( < 10,000 records
).

Quote:
>Hi !

>I've got some experience with delphi and sql databases, though not with
>DB/2.
>one thing i always noted was, that table components don't work particulary
>well
>with SQL based databases, creating an equivalent query component and making

>it updateable is definitely the recommended way. i would also suggest
>playing around
>with BDE parameters concerning transaction isolation level. there is some
>info about that
>in the bde32 help files, some of it even db2 specific.

>i hope i could help.

>Stefan Marte
>---




Sat, 03 May 2003 03:00:00 GMT
 Delphi, BDE and DB2
Hi again !

Quote:

> On Sun, 12 Nov 2000 19:57:12 +0100, Stefan Marte

> I have tried using a TQuery component with request.live = true as a
> replacement for the TTable. The Query will generate the same problem
> and be slower (due to many more BDE calls and less optimized fetches).
> It is for speed reasons that we use the table, in this case we are
> only dealing with 1 table that doesnt get very big ( < 10,000 records
> ).

actually i wasn't suggesting requestlive := true but using an update component,
attached, basically the cached update scheme that delphi uses. for me that
was usually the fastest solution. your mileage varies obviously.

regards
Stefan Marte
---



Sat, 03 May 2003 03:00:00 GMT
 Delphi, BDE and DB2
On Fri, 10 Nov 2000 20:56:04 +0100, Gert van der Kooij

Thanks for advice, I have now tried 2 different methods of tracing,
both of which havent been very helpful.

The first thing I tried was using db2trc which generates an enormous
log file that gives me way too much information.

The second thing was using the recommendation below (CLITrace) which
doesnt give me enough info. Maybe I am doing something wrong? I dont
know. This is what I set in my db2cli.ini:

[COMMON]
TRACE=1
TRACEFILENAME=C:\DB2\TRACES\driver\drivertrc1.cli
TRACEFLUSH=1

The program I am using makes many different SQL calls (SELECTS) before
I get the app to perform the update. I would have expected quite a bit
more information, however this is all I get:

--//BEGIN

[ Process: 496, Thread: 724 ]
[ Date & Time:          11-14-2000 09:37:09.000041 ]
[ Product:              QDB2/NT 7.1.0.1 ]
[ Level Identifier:     02020105 ]
[ CLI Driver Version:   07.01.0000 ]
[ Informational Tokens: "DB2 v7.1.0.1","n000727","WR21198" ]

SQLAllocHandle( fHandleType=SQL_HANDLE_ENV, hInput=0:0,
phOutput=&00421294 )
    ---> Time elapsed - 0 seconds

SQLAllocHandle( phOutput=0:1 )
    <--- SQL_SUCCESS   Time elapsed - +6.745360E-001 seconds

SQLSetEnvAttr( hEnv=0:1, fAttribute=Unknown value 2473, vParam=3,
cbParam=0 )
    ---> Time elapsed - +1.827190E-001 seconds

SQLSetEnvAttr( )
    <--- SQL_SUCCESS   Time elapsed - +2.227000E-003 seconds

--//END

This doesnt doesnt really give me any information about the nature of
my problem.

I also read some info on ODBC tracing so I will take a look at that
next.

Thanks for the feedback, everyone, I really appreciate it.

Regards
Jeff Bendixsen

Quote:

>> I realize that there are probably not alot of Delphi people around
>> here, but unfortunatly there are not alot of DB2 on the Delphi news
>> groups.

>> I have this problem where I delphi table component attempts an update
>> to a particular record in my DB2 UDB 7.1 on Win2000. Although I cant
>> see the specific CLI call the UPDATE SQL that gets passed is correct.

>> The problem is that DB2 returns "Rows Affected = -1" even though the
>> update occurs correctly. The new value gets stored in the database.
>> The BDE identifies this as a lock contention problem an returns a
>> 'Record has been modified by another user error' which is simply not
>> the case. No other users or applications are accessing the database.

>> I am wondering if it there is a configuration parameter(s) that needs
>> to be set.

>> Any help would be appreciated.

>> Jeff Bendixsen

>Hi,

>To get more information you can activate a CLI trace. It will show you
>the executed SQL and the returned SQL code etc.

>Copied from the Troubleshooting Guide:

>===== Start copy =====
>The CLI trace can be used for any CLI, ODBC, or JDBC application that
>connects to DB2 using the CLI Driver.

>To turn on this trace facility, set the db2cli.ini keyword option TRACE
>on (1). CLI trace records are appended to the file specified by the
>TRACEFILENAME keyword, or placed in the directory specified by the
>TRACEPATHNAME keyword.

>For example, to set up a CLI trace file that is written to disk after
>each trace entry, include the following lines in the common section of
>the initialization file (DB2CLI.INI).

>[COMMON]
>TRACE=1
>TRACEFILENAME=E:\TRACES\CLI\MONDAY.CLI
>TRACEFLUSH=1
>===== End copy =====

>Hope this helps.



Sat, 03 May 2003 03:00:00 GMT
 
 [ 6 post ] 

 Relevant Pages 

1. Problems BDE Delphi 3 x BDE Delphi 4

2. Connecting Delphi 4 to DB2 using BDE

3. Connecting Delphi 4 to DB2 using BDE

4. Delphi 1 clients, DB2 on Win NT Server and BDE 2.5x

5. Delphi 2 / Delphi 4 BDE-conflict ?

6. Delphi 3 to Delphi 5 TQuery / BDE problems...

7. Can a Delphi 2 App use BDE from Delphi 1

8. Delphi 3, BDE 4.0 and Delphi 3 configuration

9. Delphi 3, Delphi 4 BDE 5.01 conflict?

10. Delphi 2.0 - BDE under Win3.11 - Delphi 1.02

11. NC-Raleigh-93905--Delphi-SQL-ORACLE-DB2-Delphi Developer


 
Powered by phpBB® Forum Software