Board index » delphi » SQL Server Error: cannot update erased record

SQL Server Error: cannot update erased record


2006-01-16 06:11:21 PM
delphi277
Can anyone explain this error msg?
SQL Server Error: cannot update erased record
 
 

Re:SQL Server Error: cannot update erased record

Mikael writes:
Quote
Can anyone explain this error msg?
SQL Server Error: cannot update erased record
It probably has something to do with using a database which uses
archaic two-phase locking instead of modern versioning. I recommend
changing to InterBase at the earliest possible convenience. :)
Seriously, if you need help with MS SQL Server, then you should
probably ask in borland.public.delphi.database.sqlservers.
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Borland newsgroup denizen Sergio Gonzalez has a new CD of
Irish music out, and it is good: tinyurl.com/7hgfr
 

Re:SQL Server Error: cannot update erased record

The message you posted is not an InterBase message (IB would never say
"SQL Server Error".)
What tool is producing that message? Please give much more information
about what you are doing.
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Borland newsgroup denizen Sergio Gonzalez has a new CD of
Irish music out, and it is good: tinyurl.com/7hgfr
 

Re:SQL Server Error: cannot update erased record

Mikael writes:
Quote
this is the complete msg i generate when i get an exception.

Msg:='ThreadID: ' + IntToStr(TID) + ', FileName: ' +
XMLTransformProvider1.XMLDataFile + #10 +
'Unexpeted error in StoreTUnits: ' + #10 +
e.message + #10;
this is the output

ThreadID: 3536, FileName:
E:\Projekt\Ean\GTItems\Batch\Infiler\MNXML\Files\3879638.xml
Unexpeted error in StoreTUnits: SQL Server Error: cannot update
erased record
The "cannot update erased record" could possibly come from IB; the
"SQL Server Error" must be coming from elsewhere.
You need to figure out what the thread is doing when the error is
raised. A full call stack would probably help as that should at least
give you the query that is running.
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
IB 6 versions prior to 6.0.1.6 are pre-release and may corrupt
your DBs! Open Edition users, get 6.0.1.6 from mers.com
 

Re:SQL Server Error: cannot update erased record

I'm using Interbase!! 7.5.1
/Mikael
"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>skrev i
meddelandet news:43cb982c$XXXX@XXXXX.COM...
Quote
Mikael writes:

>Can anyone explain this error msg?
>SQL Server Error: cannot update erased record

It probably has something to do with using a database which uses
archaic two-phase locking instead of modern versioning. I recommend
changing to InterBase at the earliest possible convenience. :)

Seriously, if you need help with MS SQL Server, then you should
probably ask in borland.public.delphi.database.sqlservers.

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Borland newsgroup denizen Sergio Gonzalez has a new CD of
Irish music out, and it is good: tinyurl.com/7hgfr
 

Re:SQL Server Error: cannot update erased record

Mikael writes:
Quote
If it is not from interbase it must come from Delphi. You can see I
just display e.message.
It could well be coming from dbExpress.
Quote
How do I create a call stack i in Delphi 7?
Just view the call stack window in the IDE when the exception stops in
the de{*word*81}.
But you can not really see your locals after an exception is raised so
to log the SQL the best way to do it is within the exception handling
code itself. You may have to wrap the line of code which is executing
the statement (you'll get this from the first call stack) with a
try/except and re-raise a custom exception which includes the SQL as a
property.
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Please read and follow Borland's rules for the user of their
server: support.borland.com/entry.jspa
 

Re:SQL Server Error: cannot update erased record

Mikael writes:
Quote
Is this q better handled in DBExpress group?
Oh, probably not.
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: learningtowhistle.blogspot.com
 

Re:SQL Server Error: cannot update erased record

My program is a threaded Service that stores Xmlfiles into table(s)
in a Interbase database. The service is a Delphi 7 program. I'm
using DBExpress components.
this is the complete msg i generate when i get an exception.
Msg:='ThreadID: ' + IntToStr(TID) + ', FileName: ' +
XMLTransformProvider1.XMLDataFile + #10 +
'Unexpeted error in StoreTUnits: ' + #10 +
e.message + #10;
this is the output
ThreadID: 3536, FileName:
E:\Projekt\Ean\GTItems\Batch\Infiler\MNXML\Files\3879638.xml
Unexpeted error in StoreTUnits:
SQL Server Error: cannot update erased record
"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>skrev i
meddelandet news:43cbac03$XXXX@XXXXX.COM...
Quote
The message you posted is not an InterBase message (IB would never say
"SQL Server Error".)

What tool is producing that message? Please give much more information
about what you are doing.

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Borland newsgroup denizen Sergio Gonzalez has a new CD of
Irish music out, and it is good: tinyurl.com/7hgfr
 

Re:SQL Server Error: cannot update erased record

If it is not from interbase it must come from Delphi. You can see I just
display e.message.
How do I create a call stack i in Delphi 7?
Is this q better handled in DBExpress group?
"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>skrev i
meddelandet news:43cbb422$XXXX@XXXXX.COM...
Quote
Mikael writes:

>this is the complete msg i generate when i get an exception.
>
>Msg:='ThreadID: ' + IntToStr(TID) + ', FileName: ' +
>XMLTransformProvider1.XMLDataFile + #10 +
>'Unexpeted error in StoreTUnits: ' + #10 +
>e.message + #10;
>this is the output
>
>ThreadID: 3536, FileName:
>E:\Projekt\Ean\GTItems\Batch\Infiler\MNXML\Files\3879638.xml
>Unexpeted error in StoreTUnits: SQL Server Error: cannot update
>erased record

The "cannot update erased record" could possibly come from IB; the
"SQL Server Error" must be coming from elsewhere.

You need to figure out what the thread is doing when the error is
raised. A full call stack would probably help as that should at least
give you the query that is running.

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
IB 6 versions prior to 6.0.1.6 are pre-release and may corrupt
your DBs! Open Edition users, get 6.0.1.6 from mers.com
 

Re:SQL Server Error: cannot update erased record

The value I assignd to TransactionID, did match the identifier of an other
active transaction.
I used a constant, but now changed to thread ID.
I hope this was the problem.
Mikael
"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>skrev i
meddelandet news:43cbbb7e$XXXX@XXXXX.COM...
Quote
Mikael writes:

>Is this q better handled in DBExpress group?

Oh, probably not.

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: learningtowhistle.blogspot.com
 

Re:SQL Server Error: cannot update erased record

Sorry to say. it did not work.
Isn't DBExpres thread safe?
/M
"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>skrev i
meddelandet news:43cbbb7e$XXXX@XXXXX.COM...
Quote
Mikael writes:

>Is this q better handled in DBExpress group?

Oh, probably not.

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: learningtowhistle.blogspot.com
 

Re:SQL Server Error: cannot update erased record

Well I understand that se might have missed something or I can have done
a por application.
The application stores data from xmlfiles into a database. Since this could
be very havy traffic
and I have a dual cpu machine I designed a threaded application (TService).
The main thread starts, that many secondory threads, as said in the inifile.
Every secondory thread
creates it own datamodule. (and all work(coding) is done in the datamodule)
I am pretty sure that this error occurs when two threads is working with the
same data. That is
possible since I only have to store the last copy of the data.
ex supplier A sends an "Trade Item Declaration" to both buyer B and C.
This will cause thread 1 working with file1 and thread 2 working with file
2. Both this files has
the same data. And by the way I am never doing an update (se error message).
I do delete and then insert.
/Mikael
"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>skrev i
meddelandet news:43ce3a7c$XXXX@XXXXX.COM...
Quote
Mikael writes:

>Sorry to say. it did not work.
>Isn't DBExpres thread safe?

AFAIK it is designed to be thread-safe if you use one connection per
thread. However, it isn't clear that this is a threading error per se.

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better? Use QC!
qc.borland.com -- Vote for important issues
 

Re:SQL Server Error: cannot update erased record

Mikael writes:
Quote
The main thread starts, that many secondory threads, as said in the
inifile. Every secondory thread creates it own datamodule. (and all
work(coding) is done in the datamodule)

I am pretty sure that this error occurs when two threads is working
with the same data. That is possible since I only have to store the
last copy of the data.
I'm still concerned that you may have two threads sharing a database
connection or even a transaction. If not, make sure that you're not
leaving transactions open after they affect a row. Practically
speaking, you're *going* to get deadlocks doing what you're doing, and
you must be prepared to handle them. Imagine this:
1) Thread 1 updates row 1
2) Thread 2 starts a transaction
3) Thread 2 updates row 1 (deadlock)
4) Thread 1 commits
In a heavily multi-threaded app you can not avoid this, so you must
handle it.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better? Use QC!
qc.borland.com -- Vote for important issues
 

Re:SQL Server Error: cannot update erased record

Mikael writes:
Quote
And by the way I am never doing an update (se error message). I do
delete and then insert.
This isn't necessarily much different than an UPDATE if unique
constraints are involved.
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
IB 6 versions prior to 6.0.1.6 are pre-release and may corrupt
your DBs! Open Edition users, get 6.0.1.6 from mers.com
 

Re:SQL Server Error: cannot update erased record

Each thread creates it own datamodule. So I expect thats no sharing is done
here.
And if deadlock was the problem I expect a "deadlock error message" not
"cannot update erased record"!!!!
Mikael
"Craig Stuntz [TeamB]" <XXXX@XXXXX.COM [a.k.a. acm.org]>skrev i
meddelandet news:43d0e3cc$XXXX@XXXXX.COM...
Quote
Mikael writes:

>The main thread starts, that many secondory threads, as said in the
>inifile. Every secondory thread creates it own datamodule. (and all
>work(coding) is done in the datamodule)
>
>I am pretty sure that this error occurs when two threads is working
>with the same data. That is possible since I only have to store the
>last copy of the data.

I'm still concerned that you may have two threads sharing a database
connection or even a transaction. If not, make sure that you're not
leaving transactions open after they affect a row. Practically
speaking, you're *going* to get deadlocks doing what you're doing, and
you must be prepared to handle them. Imagine this:

1) Thread 1 updates row 1
2) Thread 2 starts a transaction
3) Thread 2 updates row 1 (deadlock)
4) Thread 1 commits

In a heavily multi-threaded app you can not avoid this, so you must
handle it.

--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
Want to help make Delphi and InterBase better? Use QC!
qc.borland.com -- Vote for important issues