473,320 Members | 1,909 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,320 software developers and data experts.

How to ensure DB changes complete?

I have two apps that run on different machines. The first app inserts a
row to an MS Access table using an ODBCDataAdapter object. Then, it sends
a message to the second machine that a new row has become available using a
winsock object. Finally, the second app receives the message and reads the
new row.

Problem is...

The actual data update completes codewise on app #1, but the message is
received and the data read in app #2 before MS Access is done taking in the
new data (I guess).

I can tell this because the data is actually added, but the second app
doesn't see it unless I put in an arbitrary delay.

I'd like to avoid unnecessary delays, plus there is the question of whether
or not the delay is not long enough at one point (because maybe the DB is
busy), what happens.

Ideas?
Sep 17 '06 #1
4 1003
This is *crazy* behavior! Here's my sequence of events now:

App #1 - Write new record using ODBCDataAdapter

App #1 - read # of rows in table using ExecuteScalar - get 21 rows

App #1 - send message to app #2 using winsock object

App #2 - receive message

App #2 - read # of rows in table - get 20 (yes, TWENTY)

check DB manually, contains 21 rows

If I put in a msgbox to simulate an arbitrary delay of a second or so,
then App #2 reads the correct number of rows. What amazes me is that
App #1 sees the proper # of rows, passes off to app #2 and it doesn't.
I'm so confused that my frickin' head hurts.

Gardner Andersen <bo******@hotmail.comwrote in
news:Xn******************************@216.196.97.1 36:
I have two apps that run on different machines. The first app inserts
a row to an MS Access table using an ODBCDataAdapter object. Then, it
sends a message to the second machine that a new row has become
available using a winsock object. Finally, the second app receives
the message and reads the new row.

Problem is...

The actual data update completes codewise on app #1, but the message
is received and the data read in app #2 before MS Access is done
taking in the new data (I guess).

I can tell this because the data is actually added, but the second app
doesn't see it unless I put in an arbitrary delay.

I'd like to avoid unnecessary delays, plus there is the question of
whether or not the delay is not long enough at one point (because
maybe the DB is busy), what happens.

Ideas?
Sep 17 '06 #2
Change the setting 'Safe Transactions' from 0 to 1 in the advanved
settings of the Access ODBC Driver.
Gardner Andersen wrote:
This is *crazy* behavior! Here's my sequence of events now:

App #1 - Write new record using ODBCDataAdapter

App #1 - read # of rows in table using ExecuteScalar - get 21 rows

App #1 - send message to app #2 using winsock object

App #2 - receive message

App #2 - read # of rows in table - get 20 (yes, TWENTY)

check DB manually, contains 21 rows

If I put in a msgbox to simulate an arbitrary delay of a second or so,
then App #2 reads the correct number of rows. What amazes me is that
App #1 sees the proper # of rows, passes off to app #2 and it doesn't.
I'm so confused that my frickin' head hurts.

Gardner Andersen <bo******@hotmail.comwrote in
news:Xn******************************@216.196.97.1 36:
>I have two apps that run on different machines. The first app inserts
a row to an MS Access table using an ODBCDataAdapter object. Then, it
sends a message to the second machine that a new row has become
available using a winsock object. Finally, the second app receives
the message and reads the new row.

Problem is...

The actual data update completes codewise on app #1, but the message
is received and the data read in app #2 before MS Access is done
taking in the new data (I guess).

I can tell this because the data is actually added, but the second app
doesn't see it unless I put in an arbitrary delay.

I'd like to avoid unnecessary delays, plus there is the question of
whether or not the delay is not long enough at one point (because
maybe the DB is busy), what happens.

Ideas?
Sep 17 '06 #3
Thanks, but that solution produced no change in behavior.

I have decided to append all of the data to the message being sent to
second application. I'll just get the data from there for the time being.
Theo Verweij <tv******@xs4all.nlwrote in news:e0v1YIk2GHA.3516
@TK2MSFTNGP06.phx.gbl:
Change the setting 'Safe Transactions' from 0 to 1 in the advanved
settings of the Access ODBC Driver.
Sep 17 '06 #4
GS
look into ODBCDataAdapter and see if there is something like transaction
end or end of transaction you can use to flush the new record to database
before passing off to App#2 via winsock.
Oh, btw , I think there is something called async execution that supposedly
allows you flexibility of taking of there thing instead of waiting for a
database completion.. And this may be the source of your pain!
"Gardner Andersen" <bo******@hotmail.comwrote in message
news:Xn******************************@216.196.97.1 36...
I have two apps that run on different machines. The first app inserts a
row to an MS Access table using an ODBCDataAdapter object. Then, it sends
a message to the second machine that a new row has become available using
a
winsock object. Finally, the second app receives the message and reads
the
new row.

Problem is...

The actual data update completes codewise on app #1, but the message is
received and the data read in app #2 before MS Access is done taking in
the
new data (I guess).

I can tell this because the data is actually added, but the second app
doesn't see it unless I put in an arbitrary delay.

I'd like to avoid unnecessary delays, plus there is the question of
whether
or not the delay is not long enough at one point (because maybe the DB is
busy), what happens.

Ideas?

Sep 18 '06 #5

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

Similar topics

0
by: Gert Wurzer | last post by:
Hi all! I hope anyone here can help me with this tough problem: I have a replication enviroment with several subscribers. Publisher:MSSQL 2000, SP3 Subscribers: MSSQL200, SP3 and MSDE2000,...
18
by: rcamarda | last post by:
I think cursors might help me, but I'm not sure. I'm looking for ideas on how to solve a problem I have. Consider two tables, one table contains student information (very wide 100 fields) , the...
4
by: tnhoe | last post by:
Hi, how do i code such that all gifs are loaded without missing any one of them ? I always get missing few gifs when the page loading with 30 gifs. I use IE6 to browse many <a...
6
by: ronwer | last post by:
Hello, The title doesn't completely cover the question I have, but it's a bit more complicated problem we have. We are using a database, based on Acces, but developed by a third party...
5
by: Grant | last post by:
Hello, How come when I add a new row to my dataset table it shows up as changed (agencyData.Haschanges() = True) but when I delete a row the dataset thinks here are no...
0
by: Jeff Reed | last post by:
I am experiencing the the problem outlined the below. Unfortunately, I am using WinXP and I not sure if I can apply the solution due to lack of security control Any feed back would be apreciated ...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
3
by: schwartzenberg | last post by:
Dear friends, I have just run into a strange DB2 problem. Something i'd some of you would answer, if only shortly. My basic question is: How do i ensure 'insensitive' (ie static) cursors...
4
by: John | last post by:
Hi, I derived a class from the Hashtable class, with ISerializable implemented and the tag added. Everything works fine with one exception. I store the hashtable in ViewState, but on a...
4
by: news.microsoft.com | last post by:
Hi all, Assume we have two entity class. Class1: Name: House Property: ID:int Name:String Desktops:Desktop
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work

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.