Skip to Content.
Sympa Menu

freetds - Re: [freetds] handling multiple users on the database

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Robert Klemme <shortcutter AT googlemail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] handling multiple users on the database
  • Date: Tue, 24 Jan 2006 19:46:19 +0100

2006/1/24, Lawrence Chu <lrychu AT yahoo.com>:
> Hi All,
>
> I am a newbie when it comes to TDS and handling sql
> databases, so bear with me if this seems obvious ...
>
> I have a mssql database and I am using freeTDS vers.
> 8.0. I have heard that mssql can handle multiple
> users on the database as long as there isn't conflict
> on the same cell at the same time. I am also using
> transactions.
>
> My problem is that when experimenting with deleting
> and loading massive amounts of data (within
> transaction), and another user is trying to retrieve
> data at the same time, both ends seem to freeze up,
> until one or the other gets off the database.
>
> 1) how do I check where the conflict is happening

You can use Enterprize Manager to check for locks and lock
dependencies. Before you do anything else you should pinpoint the
actual cause of the behavior you're perceiving.

> 2) what can I do to ensure that it does not freeze up
> when there are multiple users (configurations,
> settings, etc).

One thing you can do is to change the transaction isolation level of
one or both transactions so a tx can see changes done by another tx.
However, you should know what you are doing.

Another thing you can do is to explicitely set locks (dunno how that
is exactly done with sql server, but BOL will help youl). That way you
might be able to prevent deadlock situations. (Note though, that sql
server will kill one of two tx that participate in a deadlock in the
db; in that case your apps would not freeze but one of them would bail
out. However, you can also produce dead locks that sql server cannot
detect via application code.)

But the main thing to do is to properly design the application to
prevent these situations. This is development of concurrent
applications which is almost never trivial.

Before I forget it: there's always the option of a bug in freetds that
somehow causes the behavior you're seeing. But given the facts we have
I rather not bet on this option - I guess it's one of the other
causes.

> If this is not the right forum to raise this question,
> or if my questions are just too vague or general,
> please let me know. I'd appreciate any hints as to
> where to begin.

It's ok - as long as you can live with rather unspecific answers due
to the fact of the limited detail we have. :-)

Kind regards

robert




Archive powered by MHonArc 2.6.24.

Top of Page