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

Distributed Programming

I have a program that uses disconnected recordsets on the client side :

Here is the problem I have :

Client gets a dataset , say a customer table

Creates a new customer
Deletes this customer

Updates changes to server.

The server code detects that a record has been deleted via rowstate, takes
the new ID of the deleted record ( generated by the client side table via
setting autoincrement to true and setting the seed to the last ID + 1).

Now this causes 2 problems :

1.) It doesnt need to delete as it was only a client side record create and
deleted and therefore isnt on the sevrer.
2.) What happens if another user creates a record that is given the newly
created local ID that is the same as the one that im trying to delete.

Basically I have a problem with my distributed programming methodology. Can
someone point me to the right way to handle this ?

Thanks
Jun 27 '06 #1
6 977
Jon,

Are you using SQLClient, or OleDB, that use different methods how the
autoincrement Id is handled by the standard dataadapter update.

Cor

"Jon Vaughan" <jo**********@hotmail.com> schreef in bericht
news:0K******************@fe07.news.easynews.com.. .
I have a program that uses disconnected recordsets on the client side :

Here is the problem I have :

Client gets a dataset , say a customer table

Creates a new customer
Deletes this customer

Updates changes to server.

The server code detects that a record has been deleted via rowstate, takes
the new ID of the deleted record ( generated by the client side table via
setting autoincrement to true and setting the seed to the last ID + 1).

Now this causes 2 problems :

1.) It doesnt need to delete as it was only a client side record create
and deleted and therefore isnt on the sevrer.
2.) What happens if another user creates a record that is given the newly
created local ID that is the same as the one that im trying to delete.

Basically I have a problem with my distributed programming methodology.
Can someone point me to the right way to handle this ?

Thanks

Jun 27 '06 #2
Here is my dataaccess class sample code :

Dim cn As New SqlConnection(Connections.Value)

Dim cm As New SqlCommand("sp_here", cn)

......

cm.ExecuteNonQuery()

I presume that is SQLClient, the code is then passed into this sub via a
dataset, values are extracted from the ds and loaded into the parameters.

Hope this is the info you are looking for.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Oa**************@TK2MSFTNGP04.phx.gbl...
Jon,

Are you using SQLClient, or OleDB, that use different methods how the
autoincrement Id is handled by the standard dataadapter update.

Cor

"Jon Vaughan" <jo**********@hotmail.com> schreef in bericht
news:0K******************@fe07.news.easynews.com.. .
I have a program that uses disconnected recordsets on the client side :

Here is the problem I have :

Client gets a dataset , say a customer table

Creates a new customer
Deletes this customer

Updates changes to server.

The server code detects that a record has been deleted via rowstate,
takes the new ID of the deleted record ( generated by the client side
table via setting autoincrement to true and setting the seed to the last
ID + 1).

Now this causes 2 problems :

1.) It doesnt need to delete as it was only a client side record create
and deleted and therefore isnt on the sevrer.
2.) What happens if another user creates a record that is given the newly
created local ID that is the same as the one that im trying to delete.

Basically I have a problem with my distributed programming methodology.
Can someone point me to the right way to handle this ?

Thanks


Jun 27 '06 #3
If you use guids rather than Ints as your primary key, the problem will go
away (of course, that would likely require more redesign than you want to
undertake). That's one of the reasons why I use entity classes rather than
datasets. I can still have the data persistance as integers to the database,
but the internal collections use Guids for binding with the UI. I also have
code on the update that detects if a deleted entity is new and then doesn't
worry about issuing the update statement. It takes more up-front coding,
but I find it more maintainable down the road.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
I have a program that uses disconnected recordsets on the client side
:

Here is the problem I have :

Client gets a dataset , say a customer table

Creates a new customer
Deletes this customer
Updates changes to server.

The server code detects that a record has been deleted via rowstate,
takes the new ID of the deleted record ( generated by the client side
table via setting autoincrement to true and setting the seed to the
last ID + 1).

Now this causes 2 problems :

1.) It doesnt need to delete as it was only a client side record
create and
deleted and therefore isnt on the sevrer.
2.) What happens if another user creates a record that is given the
newly
created local ID that is the same as the one that im trying to delete.
Basically I have a problem with my distributed programming
methodology. Can someone point me to the right way to handle this ?

Thanks

Jun 27 '06 #4
Jim,

Im willing to look at anything , do you have any sample code using GUID's ?
"Jim Wooley" <ji*************@hotmail.com> wrote in message
news:24*************************@msnews.microsoft. com...
If you use guids rather than Ints as your primary key, the problem will go
away (of course, that would likely require more redesign than you want to
undertake). That's one of the reasons why I use entity classes rather than
datasets. I can still have the data persistance as integers to the
database, but the internal collections use Guids for binding with the UI.
I also have code on the update that detects if a deleted entity is new and
then doesn't worry about issuing the update statement. It takes more
up-front coding, but I find it more maintainable down the road.
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
I have a program that uses disconnected recordsets on the client side
:

Here is the problem I have :

Client gets a dataset , say a customer table

Creates a new customer
Deletes this customer
Updates changes to server.

The server code detects that a record has been deleted via rowstate,
takes the new ID of the deleted record ( generated by the client side
table via setting autoincrement to true and setting the seed to the
last ID + 1).

Now this causes 2 problems :

1.) It doesnt need to delete as it was only a client side record
create and
deleted and therefore isnt on the sevrer.
2.) What happens if another user creates a record that is given the
newly
created local ID that is the same as the one that im trying to delete.
Basically I have a problem with my distributed programming
methodology. Can someone point me to the right way to handle this ?

Thanks


Jun 27 '06 #5
I have seent his and I cna see this being a solution without to much
reworking :

Private Function getGUID() As String
GetGUID = "{" & _
System.Guid.NewGUID().ToString & "}"
End Function

Thanks all

"Jim Wooley" <ji*************@hotmail.com> wrote in message
news:24*************************@msnews.microsoft. com...
If you use guids rather than Ints as your primary key, the problem will go
away (of course, that would likely require more redesign than you want to
undertake). That's one of the reasons why I use entity classes rather than
datasets. I can still have the data persistance as integers to the
database, but the internal collections use Guids for binding with the UI.
I also have code on the update that detects if a deleted entity is new and
then doesn't worry about issuing the update statement. It takes more
up-front coding, but I find it more maintainable down the road.
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
I have a program that uses disconnected recordsets on the client side
:

Here is the problem I have :

Client gets a dataset , say a customer table

Creates a new customer
Deletes this customer
Updates changes to server.

The server code detects that a record has been deleted via rowstate,
takes the new ID of the deleted record ( generated by the client side
table via setting autoincrement to true and setting the seed to the
last ID + 1).

Now this causes 2 problems :

1.) It doesnt need to delete as it was only a client side record
create and
deleted and therefore isnt on the sevrer.
2.) What happens if another user creates a record that is given the
newly
created local ID that is the same as the one that im trying to delete.
Basically I have a problem with my distributed programming
methodology. Can someone point me to the right way to handle this ?

Thanks


Jun 27 '06 #6
Jon,

See this example, be aware that much of this code can done by the
SQLcommandbuilder in such an easy situation as this. See as well that there
is not any error handling which completely depends in what way you want to
do this: accept already done changes; rollback everything; investigate and
let the user make decissions; etc.

http://www.vb-tips.com/default.aspx?...2-d7c12bbb3726

I hope this helps,

Cor

"Jon Vaughan" <jo**********@hotmail.com> schreef in bericht
news:cB*********************@fe06.news.easynews.co m...
Here is my dataaccess class sample code :

Dim cn As New SqlConnection(Connections.Value)

Dim cm As New SqlCommand("sp_here", cn)

.....

cm.ExecuteNonQuery()

I presume that is SQLClient, the code is then passed into this sub via a
dataset, values are extracted from the ds and loaded into the parameters.

Hope this is the info you are looking for.

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:Oa**************@TK2MSFTNGP04.phx.gbl...
Jon,

Are you using SQLClient, or OleDB, that use different methods how the
autoincrement Id is handled by the standard dataadapter update.

Cor

"Jon Vaughan" <jo**********@hotmail.com> schreef in bericht
news:0K******************@fe07.news.easynews.com.. .
I have a program that uses disconnected recordsets on the client side :

Here is the problem I have :

Client gets a dataset , say a customer table

Creates a new customer
Deletes this customer

Updates changes to server.

The server code detects that a record has been deleted via rowstate,
takes the new ID of the deleted record ( generated by the client side
table via setting autoincrement to true and setting the seed to the last
ID + 1).

Now this causes 2 problems :

1.) It doesnt need to delete as it was only a client side record create
and deleted and therefore isnt on the sevrer.
2.) What happens if another user creates a record that is given the
newly created local ID that is the same as the one that im trying to
delete.

Basically I have a problem with my distributed programming methodology.
Can someone point me to the right way to handle this ?

Thanks



Jun 27 '06 #7

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

Similar topics

0
by: Constandinos Mavromoustakis | last post by:
CFP: CLADE 2004-Challenges of Large Applications in Distributed Environments ------------------------------------------------- PhD student - Dept.Informatics at Aristotle University of...
0
by: Sam Commar | last post by:
We are using a Standard Microsoft Product called Solomon which has a Web interface. We have installed this in more than 50 sites but we are getting the following error after being in the Web...
39
by: Steven T. Hatton | last post by:
I came across this while looking for information on C++ and CORBA: http://www.zeroc.com/ice.html. It got me to wondering why I need two different languages in order to write distributed computing...
6
by: apngss | last post by:
When an application needs to get information from another machine over the network, how many distributed computing choices out there? Here are the choices I know of, classifying by different...
4
by: apngss | last post by:
what's the differences between collocated architecture and distributed architecture?? My understanding is that collocated architecture has everything in a single machine? i.e. There is only 1...
1
by: Rhino | last post by:
Is there any way to install the IBM Distributed Debugger V9.2 on Windows XP without first uninstalling DB2? I installed the IBM Distributed Debugger V9.2 on my Windows XP box in the hopes of...
3
by: Tim Marsden | last post by:
I am new to distributed application programming. Could anybody give me advice on how to accomplish the following? I am writing in VB.NET. I would like to keep away from web services and IIS if...
2
by: manu.diaz.gomez | last post by:
Hello, I am looking for a good online documentation dealing with concurrent distributed programming in C++. Do you any? Cheers Manuel
7
by: Jon Davis | last post by:
I have a couple questions. First of all, would anyone consider a multi-layered programming approach (building business objects that are seperate from data access logic and seperate from user...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.