Обсуждение: locking a row from JDBC

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

locking a row from JDBC

От
Joshua Daniel Franklin
Дата:
I am rather new to JDBC and am trying to build a small java
application that will be used by a few people here. I have it
working in a single-user mode, but I would like to be able
to use some sort of locking on rows that are being edited
to make it multi-user safe. A quick google search did not turn
up anything interesting. Does anyone have any suggestions?

Thanks.

Joshua Daniel Franklin


Re: locking a row from JDBC

От
Barry Lind
Дата:
There isn't really anything specific jdbc does with locking.  You need
to understand the locking behavior of the standard SQL commands you can
issue through jdbc.  In addition to INSERT and UPDATE, I think the one
you will find most useful is the SELECT ... FOR UPDATE command.  Check
out the regular postgres docs for information on locking and the
behavior of these sql commands.

--Barry


Joshua Daniel Franklin wrote:
> I am rather new to JDBC and am trying to build a small java
> application that will be used by a few people here. I have it
> working in a single-user mode, but I would like to be able
> to use some sort of locking on rows that are being edited
> to make it multi-user safe. A quick google search did not turn
> up anything interesting. Does anyone have any suggestions?
>
> Thanks.
>
> Joshua Daniel Franklin
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>



Re: locking a row from JDBC

От
Joshua Daniel Franklin
Дата:
Thanks John and Barry, as you have discovered I am new to SQL as
well. "SELECT ... FOR UPDATE" is what I was looking for.

On Thu, 21 Nov 2002, john guthrie wrote:

> my quick "i haven't looked it up so i amy be wrong" answer is that you
> can use "select for update"
>
> --
> john guthrie
> jguthrie@psynapsetech.com (was jguthrie@air.org)

On Thu, 21 Nov 2002, Barry Lind wrote:

> There isn't really anything specific jdbc does with locking.  You need
> to understand the locking behavior of the standard SQL commands you can
> issue through jdbc.  In addition to INSERT and UPDATE, I think the one
> you will find most useful is the SELECT ... FOR UPDATE command.  Check
> out the regular postgres docs for information on locking and the
> behavior of these sql commands.
>
> --Barry
>
> Joshua Daniel Franklin wrote:
> > I am rather new to JDBC and am trying to build a small java
> > application that will be used by a few people here. I have it
> > working in a single-user mode, but I would like to be able
> > to use some sort of locking on rows that are being edited
> > to make it multi-user safe. A quick google search did not turn
> > up anything interesting. Does anyone have any suggestions?
> >
> > Thanks.
> >
> > Joshua Daniel Franklin
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
Joshua Daniel Franklin
Network Administrator
IOCC.COM