By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,236 Members | 1,839 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,236 IT Pros & Developers. It's quick & easy.

Multitier app

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
Are you sure "locking" is the right solution?

You may want to institute a timestamp on the record.
When you query it, grab the timestamp. When you
save it, check to see if the timestamp on the record
is newer than the one you have. If so, then display
the updated info and who updated it, and then
ask the user to overwrite it again.

Record locking can create some technical issues
for you and is often more problematic for
the rare instances where this conflict actually
occurs.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp

"helpful sql" <no****@stopspam.com> wrote in message
news:u1**************@TK2MSFTNGP09.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 #2

P: n/a
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.

"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:OJ**************@TK2MSFTNGP09.phx.gbl...
Are you sure "locking" is the right solution?

You may want to institute a timestamp on the record.
When you query it, grab the timestamp. When you
save it, check to see if the timestamp on the record
is newer than the one you have. If so, then display
the updated info and who updated it, and then
ask the user to overwrite it again.

Record locking can create some technical issues
for you and is often more problematic for
the rare instances where this conflict actually
occurs.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp

"helpful sql" <no****@stopspam.com> wrote in message
news:u1**************@TK2MSFTNGP09.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

This discussion thread is closed

Replies have been disabled for this discussion.