469,923 Members | 1,650 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Connection seems to cache data

I open MySQL Manager and connect to my database.

I then insert one record in to an InnoDB table in MySQL (4.0 and 4.1
alpha hosted on XP running mysqld --console).

I then retrieve the record successfully in MySQL Manager using the
existing connection. This indicates that commit is running
successfully, (I have seen this on the database trace too).

I then try to retrieve the record (through a small MySQL/TomCat
application). Sometimes it is retrieved successfully, and sometimes an
empty record set is returned.

If I reduce connection pooling (on the connection script (in
components.xconf))to min 1 max 1 connections, the record is retrieved
successfully every time.

This seems to me to indicate that existing connections created for my
TomCat app are searching on an old (maybe cached?) version of the
database. However, when by chance I get the same connection I used to
insert the record, the record is retrieved successfully.

However, the record is retrieved more often than not even when there
are 10 connections pooled, although I understand that connections are
not round-robbined and some are used more commonly than others,
supporting my suspision.

This is the only insert that uses transactions in my app, and it works
fine with Oracle. All other inserts (not using transactions) work fine
on both database servers (and both MySQL 4.1.1-alpha and 4.0.16).

Thanks very much for any time spent on this and any recommendations
for further tests or fixes.
Jul 19 '05 #1
0 1289

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Cliff Wells | last post: by
15 posts views Thread by The Fumigator | last post: by
6 posts views Thread by Paul Robinson | last post: by
4 posts views Thread by chris | last post: by
4 posts views Thread by refer_to_website | last post: by
3 posts views Thread by John | last post: by
3 posts views Thread by Martin B | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.