469,915 Members | 2,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,915 developers. It's quick & easy.

Detecting locks (using connector/j)

Hi everybody,
I am having a hard time finding any info on this subject, so I was
hoping maybe one of you could give me some pointers.
I am writing an application in Java that uses Connector/J to interface
with a MySQL database with InnoDB tables. When user #1 opens a certain
recordset I am locking this recordset in share mode. Therefore if user
#2 selects the same recordset (and thus placing a lock as well) user
#1 will not be able to update the recordset.
Is there a way to detect this, and thus making it possible to inform
user #1 that an update is currently not possible due to another lock?
Thanks very much for any help, Jonck
Jul 19 '05 #1
3 2288
Please look at my reply from http://lists.mysql.com/

"Jonck van der Kogel" <jo***@vanderkogel.net> kirjoitti viestissä
news:28**************************@posting.google.c om...
Hi everybody,
I am having a hard time finding any info on this subject, so I was
hoping maybe one of you could give me some pointers.
I am writing an application in Java that uses Connector/J to interface
with a MySQL database with InnoDB tables. When user #1 opens a certain
recordset I am locking this recordset in share mode. Therefore if user
#2 selects the same recordset (and thus placing a lock as well) user
#1 will not be able to update the recordset.
Is there a way to detect this, and thus making it possible to inform
user #1 that an update is currently not possible due to another lock?
Thanks very much for any help, Jonck

Jul 19 '05 #2
Dear Heikki,
I did a search on your name in the lists.mysql.com, but none of your
posts there answer my question directly.
I could deduce from one thread that it was not possible (the post was
about the person wanting to set the wait time to 0 in order to solve
the problem) but then again his problem was not exactly the same
problem I'm having.
So I'm still wondering, is it possible to "detect" a lock before
attempting an update? Or is the only way to find out whether the
update will be performed by attempting the update and hoping for the
best? This last solution seems very crude to me, is there really not
another option/solution?
Thanks for any help, Jonck

"Heikki Tuuri" <He**********@innodb.com> wrote in message news:<3U***************@read3.inet.fi>...
Please look at my reply from http://lists.mysql.com/

"Jonck van der Kogel" <jo***@vanderkogel.net> kirjoitti viestissä
news:28**************************@posting.google.c om...
Hi everybody,
I am having a hard time finding any info on this subject, so I was
hoping maybe one of you could give me some pointers.
I am writing an application in Java that uses Connector/J to interface
with a MySQL database with InnoDB tables. When user #1 opens a certain
recordset I am locking this recordset in share mode. Therefore if user
#2 selects the same recordset (and thus placing a lock as well) user
#1 will not be able to update the recordset.
Is there a way to detect this, and thus making it possible to inform
user #1 that an update is currently not possible due to another lock?
Thanks very much for any help, Jonck

Jul 19 '05 #3
Dear Heikki,
I did a search on your name in the lists.mysql.com, but none of your
posts there answer my question directly.
I could deduce from one thread that it was not possible (the post was
about the person wanting to set the wait time to 0 in order to solve
the problem) but then again his problem was not exactly the same
problem I'm having.
So I'm still wondering, is it possible to "detect" a lock before
attempting an update? Or is the only way to find out whether the
update will be performed by attempting the update and hoping for the
best? This last solution seems very crude to me, is there really not
another option/solution?
Thanks for any help, Jonck

"Heikki Tuuri" <He**********@innodb.com> wrote in message news:<3U***************@read3.inet.fi>...
Please look at my reply from http://lists.mysql.com/

"Jonck van der Kogel" <jo***@vanderkogel.net> kirjoitti viestissä
news:28**************************@posting.google.c om...
Hi everybody,
I am having a hard time finding any info on this subject, so I was
hoping maybe one of you could give me some pointers.
I am writing an application in Java that uses Connector/J to interface
with a MySQL database with InnoDB tables. When user #1 opens a certain
recordset I am locking this recordset in share mode. Therefore if user
#2 selects the same recordset (and thus placing a lock as well) user
#1 will not be able to update the recordset.
Is there a way to detect this, and thus making it possible to inform
user #1 that an update is currently not possible due to another lock?
Thanks very much for any help, Jonck

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jonck van der Kogel | last post: by
reply views Thread by Fast Eddie | last post: by
7 posts views Thread by wij | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.