473,399 Members | 2,478 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,399 software developers and data experts.

Inserted record doesn't seem to be commited



greeting,
In short, I have a database data directory, 2 Mysql daemon are running
parallel over it through different port and sock. Now I found a problem
that for daemon "A" its read and write are performing well, but for
daemon "B", its read operation is fine, but when I issue "insert"
statement with "B", the new record is cache:
1, from daemon B, I can see the record with "select" statement.
2, no warning/error messge after the insert operation.
3, from daemon A, I can't see the record! Data is not writen to the disk.
4, after daemon B is stop and close, record gone and next time if B will
come up again, record is not there of cause.
I've checked the unix level read/write access...all seem fine.

Why the record is not commited to the disk?
How to solve, or trace?
regards,
sheng
Jul 20 '05 #1
1 1436
bunnytail wrote:
In short, I have a database data directory, 2 Mysql daemon are running
parallel over it through different port and sock.


Don't run two instances of MySQL that use the same data directory. You
will certainly corrupt your databases!

The database process keeps some data in its memory, and writes it to
disk when it can do so efficiently. This is the point of caching. But
it means that the data on disk is not necessarily the current view of
the database while the MySQL process is running.

When you inserted a record with daemon "B", it either conflicted with a
file lock and failed without checking for error (because it assumes it
is the only one writing to a database file), or else daemon "A"
immediately overwrote the change that "B" made. This might have been
coincedental; you shouldn't rely on it.

In any case, I'm surprised it worked as well as it did. It's not
unlikely that the database would be rendered unusable by both daemons
when you try operations like you did.

If you need two MySQL instances for load-balancing or failover, they
*MUST* each use their own data directory. Use MySQL Replication if you
need to keep databases in sync.

Regards,
Bill K.
Jul 20 '05 #2

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

Similar topics

1
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware ...
2
by: george | last post by:
This is like the bug from hell. It is kind of hard to explain, so please bear with me. Background Info: SQL Server 7.0, on an NT box, Active Server pages with Javascript, using ADO objects. ...
1
by: Craig | last post by:
In ASP.NET 2.0 and the formview control how do you get the value of the identity field of a newly inserted record? In ASP.NET 1.1 after the new record was saved you just said intNewIdentityID =...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
5
by: Jan | last post by:
Hello, Just after the new record is inserted in the database using a Detailsview control, i would like to display a short message "the record is inserted". In the aspx file, i defined a...
1
by: andy | last post by:
I have several forms with formviewa on them. When a new record is inserted the users want to see the readonly version of that record. Default behaviour is to show the first record in the...
2
by: TimSki | last post by:
Hi, In my asp page I am inserting a record in to the sql server 2005 db as follows... OpenDataConnection() oConn.BeginTrans set cm = CreateObject("ADODB.Command") set cm.ActiveConnection =...
0
by: fig000 | last post by:
Hi, I'm using an objectdatasource. The insert procedure called by the objectdatasource is in a separate library file outside of the aspx and the codebehind that is using the objectdatasource in...
2
by: HotFrost | last post by:
Hello everyone, i am trying to work with linked servers... The local server is the one used by UPS worldwide software (it is Microsoft SQL Server Desktop Engine, v 8.00.2050). The linked server...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.