Обсуждение: Locking a table...

Поиск
Список
Период
Сортировка

Locking a table...

От
"Scott Burgess"
Дата:
Hi,
    Quick question: In my Java app, when a database table is locked (LOCK TABLE
tablename), if I go to access / change something in this table while it's
locked, I get an error message back saying the relation does not exist, yet
as soon as the lock is released, the java app works fine again.

Is this supposed to work this way? Is it a JDBC specification or specific to
the Postgres implementation?


Thanks in advance,

Scott Burgess.


Re: Locking a table...

От
Dave Cramer
Дата:
Scott,

I just tried this with psql and the only thing that happens is that the
second query blocks until the lock is released. Within the first
transaction that locks the table you should be able to do anything. This
means that you need to be using the same connection that locks the
table.

Dave
On Fri, 2002-05-03 at 03:26, Scott Burgess wrote:
> Hi,
>     Quick question: In my Java app, when a database table is locked (LOCK TABLE
> tablename), if I go to access / change something in this table while it's
> locked, I get an error message back saying the relation does not exist, yet
> as soon as the lock is released, the java app works fine again.
>
> Is this supposed to work this way? Is it a JDBC specification or specific to
> the Postgres implementation?
>
>
> Thanks in advance,
>
> Scott Burgess.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
>