 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rhea Urusky Guest
|
Posted: Mon Sep 29, 2003 6:06 pm Post subject: Locking Problem with Sybase SQLAnywhere 8.0.2 Databases |
|
|
I upgraded from Sybase SqlAnywhere 6 to 8 a few months ago and have had
locking issues ever since. I have responses that indicate the transactions
must not be committed for these locking problems to be occurring. I use
Delphi 5 and cached updates alot. I have these within transactions so I
don't know why they would not be committed. I do use TQuery components in
several instances to update or insert a row. For example:
If not Query_CancelInv.Prepared then
Query_CancelInv.Prepare;
with Query_CancelInv do
begin
close;
ParamByName('Invoice').value := sCurInv;
Open;
Insert;
Post;
end;
Does doing an insert this way not commit the change to the database? We use
ODBC to connect to the databases which uses autocommit from what I
understand from what I've read. I am at a loss as to what is happening and
need to figure out how to eliminate these locks. Thanks for any advice.
|
|
| Back to top |
|
 |
Aage Johansen Guest
|
Posted: Mon Sep 29, 2003 9:12 pm Post subject: Re: Locking Problem with Sybase SQLAnywhere 8.0.2 Databases |
|
|
On Mon, 29 Sep 2003 12:06:49 -0600, Rhea Urusky <rheau (AT) beaverplastics (DOT) com>
wrote:
| Quote: |
If not Query_CancelInv.Prepared then
Query_CancelInv.Prepare;
with Query_CancelInv do
begin
close;
ParamByName('Invoice').value := sCurInv;
Open;
Insert;
Post;
end;
Does doing an insert this way not commit the change to the database? We
use
ODBC to connect to the databases which uses autocommit from what I
understand from what I've read. I am at a loss as to what is happening
and
need to figure out how to eliminate these locks. Thanks for any advice.
|
I haven't used CachedUpdates (or Sybase Anywhere) at all, so this may be
way off the mark...
Maybe you should change
| Quote: | Open;
Insert;
Post;
to |
ExecSQL;
The operation will be committed if you are using AutoCommit. Otherwise,
doing an explicit commit yourself will probably be a good thing (if nothing
more should happen in this transaction).
--
Aage J.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|