473,699 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Updates not visible to client

Hi, could someone explain the following please?

I have a Java application (app A) which "polls" a MySQL database table
for records with a certain column set to 0. It runs continuously,
utilising the same commection repeatedly.

The other day, I had a support call raised, whereby there were clearly
suitable records in the database, but my application was not selecting
them.

I wrote a standalone test app (app B) to read the same table and list
the records with the column=0. Sure enough, this app listed records as
requested.

So, app A retrieved zero records whilst app B retrieved many. Both
apps *are* using the same select statement.

I think it might be something to do with the rules governing when
updates become visible to clients.

The application that writes records to the database is not mine so I
don't know all the details. It's a php webapp that seems pretty simple
and just does plain inserts into the table with no attempt to do
anything non-default wrt locking afaik.

Any useful comments or clues to help explain this most gratefully
received.

Regards

Martin
Jul 23 '05 #1
7 1645
Martin Woolley wrote:
I think it might be something to do with the rules governing when
updates become visible to clients.


There are no such rules. The error is propably in the app A, which
either fails to do the queries, or fails to show the results to user.
Jul 23 '05 #2
Aggro <sp**********@y ahoo.com> wrote in message news:<l1******* ********@read3. inet.fi>...

There are no such rules. The error is propably in the app A, which
either fails to do the queries, or fails to show the results to user.


There most certainly are such rules. They relate to the way that locks
are applied and associated updates made visible. See
http://dev.mysql.com/doc/mysql/en/an...nsactions.html for some
comment on this.

App A runs 24x7 and has exhibited no issues in this area at all until
this one incident occured. If there's an issue with this application
then it is something subtle. All it does is

1. Get connection
2. Repeat
2.1 select * from table where condition limit n
2.2 sleep 5 seconds
2.3 Repeat this loop forever

And like I said, this one time, App A executing the select in 2.1
retrieved zero records whilst App B executing the same select
retrieved some records.

What I haven't found out yet is what storage model the MySQL database
is using.

Anyway, the issue may have nothing to do with locks either, I just
wanted to explore this with any real experts out there (ie people who
at least are aware of such issues).
Jul 23 '05 #3
Martin Woolley wrote:
There most certainly are such rules. They relate to the way that locks
are applied and associated updates made visible. See
http://dev.mysql.com/doc/mysql/en/an...nsactions.html for some
comment on this.
Yes I know that, but you explained that the PHP app doen't use any of
those. I ment that there are no hidden rules that would cause the
behaviour you explained.
1. Get connection
2. Repeat
2.1 select * from table where condition limit n
2.2 sleep 5 seconds
2.3 Repeat this loop forever


You never reset the connection? What if there is a network failure and
client gets disconnected? Or there might be some mystic connection
buffer that gets full over the time.

Did the application get the new data after it was restarted?
Jul 23 '05 #4
Aggro <sp**********@y ahoo.com> wrote in message news:<D3******* ********@read3. inet.fi>...
Martin Woolley wrote:
There most certainly are such rules. They relate to the way that locks
are applied and associated updates made visible. See
http://dev.mysql.com/doc/mysql/en/an...nsactions.html for some
comment on this.


Yes I know that, but you explained that the PHP app doen't use any of
those. I ment that there are no hidden rules that would cause the
behaviour you explained.
1. Get connection
2. Repeat
2.1 select * from table where condition limit n
2.2 sleep 5 seconds
2.3 Repeat this loop forever


You never reset the connection? What if there is a network failure and
client gets disconnected? Or there might be some mystic connection
buffer that gets full over the time.

Did the application get the new data after it was restarted?

Thanks for clarifying.

If there's network failure then the application takes care of
reconnecting itself. This actually happens quite frequently (at least
once a day) for reasons I won't go into, and the recovery code seems
quite reliable and robust. As it's a java app it's reliant on the
MySQL JDBC driver to report such issues. I did note yesterday that the
driver has an auto-reconnect parameter I could set, but at present I
do not and attempt to handle all such issues in the application.

The application did get the new data after it was restarted. So it
does sound like maybe the old connection was invalidated in some way.
What do you think? I don't understand how it could become
"invalidate d" without this resulting in an Exception being thrown by
the JDBC driver.
Jul 23 '05 #5
Martin Woolley wrote:
The application did get the new data after it was restarted. So it
does sound like maybe the old connection was invalidated in some way.
What do you think?


I would first test how the application handles situation where network
cable in unplugged and then reattached after at least one failed query.

If the application doesn't handle that situation I would make a guess
that the problem is there. If it handles that situation I might try to
test other possible scenarios, like database server shutdown -> start
situation.

If the application handles all that then I could only wonder what the
reason was. And then I would try to add some debug data to the
application to find out more of the cause, next time the connection fails.
Jul 23 '05 #6
Aggro <sp**********@y ahoo.com> wrote in message news:<7T******* *****@read3.ine t.fi>...
Martin Woolley wrote:
The application did get the new data after it was restarted. So it
does sound like maybe the old connection was invalidated in some way.
What do you think?


I would first test how the application handles situation where network
cable in unplugged and then reattached after at least one failed query.

If the application doesn't handle that situation I would make a guess
that the problem is there. If it handles that situation I might try to
test other possible scenarios, like database server shutdown -> start
situation.

If the application handles all that then I could only wonder what the
reason was. And then I would try to add some debug data to the
application to find out more of the cause, next time the connection fails.


Thanks for these suggestions. I've tested these scenarios
previously.... but I wonder if there's some specific combination of
conditions in these situations... which I have not tested. OK, so no
magic solution.... looks like the only way to solve this is to work
hard to try and recreate the issue in my test environment.

Regards

Martin
Jul 23 '05 #7
ma****@woolleyn et.com (Martin Woolley) wrote in message news:<e7******* *************** ****@posting.go ogle.com>...
Aggro <sp**********@y ahoo.com> wrote in message news:<7T******* *****@read3.ine t.fi>...
Martin Woolley wrote:
The application did get the new data after it was restarted. So it
does sound like maybe the old connection was invalidated in some way.
What do you think?


I would first test how the application handles situation where network
cable in unplugged and then reattached after at least one failed query.

If the application doesn't handle that situation I would make a guess
that the problem is there. If it handles that situation I might try to
test other possible scenarios, like database server shutdown -> start
situation.

If the application handles all that then I could only wonder what the
reason was. And then I would try to add some debug data to the
application to find out more of the cause, next time the connection fails.


Thanks for these suggestions. I've tested these scenarios
previously.... but I wonder if there's some specific combination of
conditions in these situations... which I have not tested. OK, so no
magic solution.... looks like the only way to solve this is to work
hard to try and recreate the issue in my test environment.

Regards

Martin

I don't quite have proof but.... the incident occurred again, this
time with some extra debug in App A. The debug suggests that the
database read loop is blocking somewhere. My guess therefore (to be
confimed by even more debug now that I know where to put it) is that
it's sitting there waiting for the SQL execution to return... or
something like this. If the issue is that the connection has become
"stale" then I don't understand why I'm not getting a SQLException
from the JDBC driver.
http://dev.mysql.com/doc/connector/j...html#id3029128
describes what's meant to happen.

Any thoughts on why blocking might occur?

Martin
Jul 23 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3474
by: mstjean | last post by:
Beginning to look at the mechanics of deployment at our site for our new project, our first in .NET. Management insists all apps will run from the network, not from desktops and we've managed to figure that out; Application exe files will each reside in their own network folders under N:\NETAPPS, and the strongly named assemblies which are referenced in the GAC are *ALL* located in a single folder, N:\ASSEMBLIES. When there are updates...
3
3311
by: Nick L. | last post by:
All, This is a general question regarding how, and if, compiler optimization techniques affect the general concept of being able to update a component of an application without requiring a recompile of client code. For example, suppose I have component: common.dll which defines several constant values, say Const_A, Const_B and Const_C. Further say I have some client code in another component: client.dll which references common.dll and...
1
3611
by: John | last post by:
I have a panel on a webpage. I use client Javacript to manipulate its visibility using something like: Panel.style.display = 'none'. During a postback, getting the Visible attribute always returns true whether the panel was visible or not. Is there another Javascript method to turn on/off a Panel's visibility *and* whose attribute can be read from code behind? I am thinking of using a hidden field as a flag placeholder which can be used...
0
1259
by: aeshtry | last post by:
Hello dear friends I have an urgent question. Would you please give me your professional idea? I have an html table containing the ASP.Net validation summary and an ASP.Net label control. The table background has different color than other sections. I want to show the error message inside a section (with different background color) only when an error occurred. This error can be a validation client error (generated by validation controls...
9
3342
by: WRH | last post by:
Hello I am new to asp but I made some Jscript functions which work fine. The functions contain some strings used as a registration key for some apps. It is important that these strings not be visible to a client using a browser. My question is...can a knowledgeable browser user view Jscript source code in an asp file?
4
1709
by: T.H.N. | last post by:
I'm trying to work out a database design to make it quicker for my client program to read and display updates to the data set. Currently it reads in the entire data set again after each change, which was acceptable when the data set was small but now it's large enough to start causing noticable delays. I've come up with a possible solution but am looking for others' input on its suitability to the problem. Here is the DDL for one of the...
3
1318
by: Bryan | last post by:
I think it's okay to ask this question in this group, but if not please point me to the correct one! How does one go about doing asynchronous updates between two web clients? Take Google Chat for example... how does Google Chat update a chatter's chat window with text entered by the other chatter?
1
2540
by: Gimzo | last post by:
Hi, I'm trying to create a button that opens a new window for setting up a whole crapload of constants for an analysis program. For this, I have a JButton. The actionPerformed-method activates another method in the master class, which creates a new JFrame. The JFrame contains a JTable which has it's own TableModel, also residing within the master class. The JTable reads it's data from an array, which is updated or not depending on the...
4
1215
dbrewerton
by: dbrewerton | last post by:
Ok, I'm using code-behind with a MySQL DB to update two tables. It updates the addressbook table fine but the device table won't update. I know its probably some stupid syntax error but I am not seeing it. To be sure I have the right variables set, I am using labels for the IDs. The ID numbers are correct. Can someone help? Thanks. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8908
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7745
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5869
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.