473,412 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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 2395
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jonck van der Kogel | last post by:
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...
0
by: Eric | last post by:
I built a webservice and it needs to pass large amounts of data (50MB+). I built a VB6 test app that uses soap to call the webservice. When the stream of data getting passed back gets larger...
0
by: Fast Eddie | last post by:
Hi, I'm writing a program (using mysql++) where I want users to be able to lock a row while they are editing it. My problem is I don't know how the 2nd user can detect the lock vs it looking...
7
by: wij | last post by:
Hi: Is there better way of detecting multiplication overflow for type long than by using double precision of lldiv to verify the result? Thanks in advance. I.J.Wang
3
by: =B= | last post by:
Hi all, I was wondering if anyone has had any luck with trapping the <BODY> onUnload() event in ASP.NET? The thing is, I'm writing code for an Intranet site. The code makes a call to a...
0
by: Nalla | last post by:
Hi, I have a requirement to call webservices from my old C++ application.So first I tried with Vc++.net as follows.....There are 2 approach Dotnet frame work and soaptoolkit 3.0 I am not able to...
3
by: nethajireddy | last post by:
can any one please suggest me that how to get it back the laptop ide connector to working condition previously its connected to xp laptop and connected another hard drive, now its showig that...
3
by: arasub | last post by:
ep 20, 2007 11:25:57 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found...
2
by: makennedy | last post by:
Hi Experts, Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere. Basically I have a TreeView Control which I have created...
1
by: vikassawant | last post by:
Hi, I m facing some critical problem for downloading 5mb file from server. Does anyone know? How to reduce the time to download file from server using HTTP connection?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.