network commit

2002-12-10 Thread John David Duncan
Hello,

I am wondering about the case where a client sends
  mysql_query(commit)
but never gets a response.

Is the transaction complete, or not?  Perhaps the commit was lost in the
network -- but, on the other hand, perhaps the server committed the
transaction and the reply was lost in the network.  The client might get a
RST or timeout without knowing which of these two events occured, right?
(unless, I suppose, it is known that the server will delay the actual
commit until it gets an TCP ACK of its reply...)

If this is a problem, are there any plans to resolve it in future
revisions of the mysql network protocol?

Thanks,
JD



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: network commit

2002-12-10 Thread Benjamin Pflugmann
Hello.

On Tue 2002-12-10 at 21:30:21 -0800, [EMAIL PROTECTED] wrote:
 Hello,
 
 I am wondering about the case where a client sends
   mysql_query(commit)
 but never gets a response.
 
 Is the transaction complete, or not?  Perhaps the commit was lost in the
 network -- but, on the other hand, perhaps the server committed the
 transaction and the reply was lost in the network.  The client might get a
 RST or timeout without knowing which of these two events occured, right?
 (unless, I suppose, it is known that the server will delay the actual
 commit until it gets an TCP ACK of its reply...)

In this case, you have the same problem, just the other way: The
server may crash and you do not know if it received the ACK or not.

 If this is a problem, are there any plans to resolve it in future
 revisions of the mysql network protocol?

AFAICT, there is no way to make this 100% safe regarding the network
protocol. IMHO it is up to the application to handle a task list. If
you make it part of the database, you can modify it as part of the
transaction. This way you can look up the task list after reconnect in
order to determine whether the commit succeeded or not. There are
other ways, though, based on the same idea.

Correct me, if I am wrong. Indeed I would be happy about that. ;)

HTH,

Benjamin.

-- 
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php