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

multitier app

Hi,
I am new to multitier app development. I am working on a windows app
that will have business layer and data access layer components. When users
log into the client app, it connects to the business layer to get a list of
records that it then uses to populate a datagrid. The business layer
component in turn gets these records from Sql Server database using the data
access layer.
When a user highlight any record displayed in the datagrid, I need to
lock that record for editing and stop other users from editing that record.
My question is how do I flag that record to indicate other users that this
record is being edited by another user. I was first thinking of having a
Flag field in the underlying table and update the Flag field in the table
everytime the user highlights a row. But then I thought this would involve
too many unnecessary read/write operations on the table. So I am thinking of
maintaining the list of rows in the business layer and flag them only on the
business layer without having to flag them in the Sql Server table.
Everytime the user highlights a row it will check the Flag value of that
record on the business layer and if it is not being edited by any other user
it will lock that record and allow the user to edit it.

Is this possible? Do I need to use .Net Remoting for this? Are there any
better options?

Thanks in advance.

Mar 28 '06 #1
3 1113
I think you'll find the following article helpful:

http://msdn.microsoft.com/library/de...tml/BOAGag.asp

This discusses all of the issues involved, including record locking.
Basically, it's not practical to keep each client up-to-date about what
records are being edited at any given time, and the recommended strategy is
to use either optimistic or pessimistic concurrency in your app. With
pessimistic concurrency, the record is locked in the database when a client
begins to edit that record. No other client will be able to lock that record
for editing until it is unlocked. The downside is that the connection to the
database must remain opened while the user is working with the record. With
optimistic concurrency, the record is not locked, but when the update
attempt is made, it fails if the record was changed since fetched by that
client.

In both cases, the general strategy is to use exception handling to deal
with the issue. In the case of pessimistic concurrency, an exception will be
thrown if a user attempts to get a lock on the record. With optimistic
concurrency, an exception will be thrown when the user attempts to update
the record.

The article provides a great deal more information, but that's a summary for
you.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"helpful sql" <no****@stopspam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,
I am new to multitier app development. I am working on a windows app
that will have business layer and data access layer components. When users
log into the client app, it connects to the business layer to get a list
of
records that it then uses to populate a datagrid. The business layer
component in turn gets these records from Sql Server database using the
data
access layer.
When a user highlight any record displayed in the datagrid, I need to
lock that record for editing and stop other users from editing that
record.
My question is how do I flag that record to indicate other users that this
record is being edited by another user. I was first thinking of having a
Flag field in the underlying table and update the Flag field in the table
everytime the user highlights a row. But then I thought this would involve
too many unnecessary read/write operations on the table. So I am thinking
of
maintaining the list of rows in the business layer and flag them only on
the
business layer without having to flag them in the Sql Server table.
Everytime the user highlights a row it will check the Flag value of that
record on the business layer and if it is not being edited by any other
user
it will lock that record and allow the user to edit it.

Is this possible? Do I need to use .Net Remoting for this? Are there
any
better options?

Thanks in advance.

Mar 28 '06 #2
Thanks for your reply.

The records are scheduled call activity records and we want to show the same
list of calls to many users and make sure that no two users are calling the
same person.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I think you'll find the following article helpful:

http://msdn.microsoft.com/library/de...tml/BOAGag.asp

This discusses all of the issues involved, including record locking.
Basically, it's not practical to keep each client up-to-date about what
records are being edited at any given time, and the recommended strategy
is to use either optimistic or pessimistic concurrency in your app. With
pessimistic concurrency, the record is locked in the database when a
client begins to edit that record. No other client will be able to lock
that record for editing until it is unlocked. The downside is that the
connection to the database must remain opened while the user is working
with the record. With optimistic concurrency, the record is not locked,
but when the update attempt is made, it fails if the record was changed
since fetched by that client.

In both cases, the general strategy is to use exception handling to deal
with the issue. In the case of pessimistic concurrency, an exception will
be thrown if a user attempts to get a lock on the record. With optimistic
concurrency, an exception will be thrown when the user attempts to update
the record.

The article provides a great deal more information, but that's a summary
for you.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"helpful sql" <no****@stopspam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,
I am new to multitier app development. I am working on a windows app
that will have business layer and data access layer components. When
users
log into the client app, it connects to the business layer to get a list
of
records that it then uses to populate a datagrid. The business layer
component in turn gets these records from Sql Server database using the
data
access layer.
When a user highlight any record displayed in the datagrid, I need to
lock that record for editing and stop other users from editing that
record.
My question is how do I flag that record to indicate other users that
this
record is being edited by another user. I was first thinking of having a
Flag field in the underlying table and update the Flag field in the table
everytime the user highlights a row. But then I thought this would
involve
too many unnecessary read/write operations on the table. So I am thinking
of
maintaining the list of rows in the business layer and flag them only on
the
business layer without having to flag them in the Sql Server table.
Everytime the user highlights a row it will check the Flag value of that
record on the business layer and if it is not being edited by any other
user
it will lock that record and allow the user to edit it.

Is this possible? Do I need to use .Net Remoting for this? Are there
any
better options?

Thanks in advance.


Mar 29 '06 #3
> The records are scheduled call activity records and we want to show the
same list of calls to many users and make sure that no two users are
calling the same person.

In that case, you should find the article extremely helpful. Good luck!

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"helpful sql" <no****@stopspam.com> wrote in message
news:eH**************@TK2MSFTNGP14.phx.gbl... Thanks for your reply.

The records are scheduled call activity records and we want to show the
same list of calls to many users and make sure that no two users are
calling the same person.

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I think you'll find the following article helpful:

http://msdn.microsoft.com/library/de...tml/BOAGag.asp

This discusses all of the issues involved, including record locking.
Basically, it's not practical to keep each client up-to-date about what
records are being edited at any given time, and the recommended strategy
is to use either optimistic or pessimistic concurrency in your app. With
pessimistic concurrency, the record is locked in the database when a
client begins to edit that record. No other client will be able to lock
that record for editing until it is unlocked. The downside is that the
connection to the database must remain opened while the user is working
with the record. With optimistic concurrency, the record is not locked,
but when the update attempt is made, it fails if the record was changed
since fetched by that client.

In both cases, the general strategy is to use exception handling to deal
with the issue. In the case of pessimistic concurrency, an exception will
be thrown if a user attempts to get a lock on the record. With optimistic
concurrency, an exception will be thrown when the user attempts to update
the record.

The article provides a great deal more information, but that's a summary
for you.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

"helpful sql" <no****@stopspam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi,
I am new to multitier app development. I am working on a windows app
that will have business layer and data access layer components. When
users
log into the client app, it connects to the business layer to get a list
of
records that it then uses to populate a datagrid. The business layer
component in turn gets these records from Sql Server database using the
data
access layer.
When a user highlight any record displayed in the datagrid, I need to
lock that record for editing and stop other users from editing that
record.
My question is how do I flag that record to indicate other users that
this
record is being edited by another user. I was first thinking of having a
Flag field in the underlying table and update the Flag field in the
table
everytime the user highlights a row. But then I thought this would
involve
too many unnecessary read/write operations on the table. So I am
thinking of
maintaining the list of rows in the business layer and flag them only on
the
business layer without having to flag them in the Sql Server table.
Everytime the user highlights a row it will check the Flag value of that
record on the business layer and if it is not being edited by any other
user
it will lock that record and allow the user to edit it.

Is this possible? Do I need to use .Net Remoting for this? Are there
any
better options?

Thanks in advance.



Mar 29 '06 #4

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

Similar topics

0
by: Joan MacEachern | last post by:
This paper presents an availability analysis for multitier, Java(tm) and Web-based application deployments running on the Sun(tm) ONE Application Server 7, Enterprise Edition software. The...
1
by: Chuck Spears | last post by:
Does python have a component model? I'm currently using delphi and C++ builder to build windows apps and I am looking to also support linux. They seem to be waffling on their linux support so I...
6
by: Jerry Orr | last post by:
We are trying to determine the easiest (and cheapest) way to get connections for about 50 Win2K workstations on our LAN to DB2 on a z/OS server. We could install DB2 Connect Personal Edition on...
14
by: Joe Fallon | last post by:
I am trying to build a Data Access Layer for a SQL Server back end. My class has a number of methods in it. The constructor takes a connection string. I currently have to instantiate an object...
11
by: ljlevend2 | last post by:
Does anybody know if there are plans to add improved support for multi-core processors in VB? It is easy to launch a process on a new thread in VB, but in a real world application it can take a...
15
by: dn | last post by:
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a business layer, a data access layer, and a SQL Server 2005 database, and I have a question. In the business and data...
4
by: Martyn Fewtrell | last post by:
Hi there I am just canvassing some opinions so feel free to add yours. I mainly work with VB.Net on dynamic websites driven by Access and have more recently been trying to introduce Business...
2
by: helpful sql | last post by:
Hi, I am new to multitier app development. I am working on a windows app that will have business layer and data access layer components. When users log into the client app, it connects to the...
3
by: helpful sql | last post by:
Hi, I am new to multitier app development. I am working on a windows app that will have business layer and data access layer components. When users log into the client app, it connects to the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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)...
1
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.