Board index » delphi » How can I refresh data in multi-user environment

How can I refresh data in multi-user environment

Hello everybody,

  My application in a Network run , When i post update with any table
record,
 How can refresh the table data see i changed it for other user?
I use Delphi6 + IBX6.01 :
  IBTransaction set defaultaction = TaCommit;
  properties: Read commited
              read_committed
              rec_version
              nowait ;

 

Re:How can I refresh data in multi-user environment


Quote
Rich Ding wrote:

>   My application in a Network run , When i post update with any table
> record,
>  How can refresh the table data see i changed it for other user?

        Do you mean, "How can I see changes made by other users when I refresh
the table?"  Or do you mean, "How can other users see my changes?"

        If it's the former, you need this:

Quote
>   IBTransaction set defaultaction = TaCommit;
>   properties: Read commited
>               read_committed
>               rec_version
>               nowait ;

        ...and you need to re-execute the query by closing the dataset and
reopening it.

        If it's the latter, the other users need to do the same thing.

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Re:How can I refresh data in multi-user environment


Hello  Craig Stuntz ,

   I mean "How can other users see my changes?" , Sorry my  broken english .
    Mabye there  is  somthing  woring with my  IBTr's porperties set  ,  now
it's ok!
  Thinks a lot!

Rich Ding

"Craig Stuntz (TeamB)" <cstuntz@no_spam.vertexsoftware.com>
??????:3C0797F4.8C3A6408@no_spam.vertexsoftware.com...

Quote

> Rich Ding wrote:

> >   My application in a Network run , When i post update with any table
> > record,
> >  How can refresh the table data see i changed it for other user?

> Do you mean, "How can I see changes made by other users when I refresh
> the table?"  Or do you mean, "How can other users see my changes?"

> If it's the former, you need this:

> >   IBTransaction set defaultaction = TaCommit;
> >   properties: Read commited
> >               read_committed
> >               rec_version
> >               nowait ;

> ...and you need to re-execute the query by closing the dataset and
> reopening it.

> If it's the latter, the other users need to do the same thing.

> HTH,

> -Craig

> --
>  Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
> We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
>      Delphi/InterBase WebLog: http://delphi.weblogs.com

Re:How can I refresh data in multi-user environment


You need to re-query.

--
Martijn Tonies
Upscene Productions

InterBase Workbench - The Developer Tool for InterBase
http://www.interbaseworkbench.com

"Experience is what you get when you didn't get what you wanted"

"Rich Ding" <a...@21cn.com> schreef in bericht news:3c07a760$1_1@dnews...

Quote
> Hello  Craig Stuntz ,

>    I mean "How can other users see my changes?" , Sorry my  broken english
.
>     Mabye there  is  somthing  woring with my  IBTr's porperties set  ,
now
> it's ok!
>   Thinks a lot!

> Rich Ding

> "Craig Stuntz (TeamB)" <cstuntz@no_spam.vertexsoftware.com>
> ??????:3C0797F4.8C3A6408@no_spam.vertexsoftware.com...

> > Rich Ding wrote:

> > >   My application in a Network run , When i post update with any table
> > > record,
> > >  How can refresh the table data see i changed it for other user?

> > Do you mean, "How can I see changes made by other users when I refresh
> > the table?"  Or do you mean, "How can other users see my changes?"

> > If it's the former, you need this:

> > >   IBTransaction set defaultaction = TaCommit;
> > >   properties: Read commited
> > >               read_committed
> > >               rec_version
> > >               nowait ;

> > ...and you need to re-execute the query by closing the dataset and
> > reopening it.

> > If it's the latter, the other users need to do the same thing.

> > HTH,

> > -Craig

> > --
> >  Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
> > We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
> >      Delphi/InterBase WebLog: http://delphi.weblogs.com

Re:How can I refresh data in multi-user environment


Quote
> You need to re-query.

> --
> Martijn Tonies
> Upscene Productions

"How can other users see my changes?" ...

'WHEN' should we use re-query in order to enable other user to see my
changes ? every 30min ? 1 hour ? coz other user may not know when we make a
changes ...

if many records need to make changes or many records need to insert in the
database, so, how often we need to re-query ? re-query everytime before we
press 'INSERT' ? will it slow down / insufficient to do so ?

Re:How can I refresh data in multi-user environment


Quote
lee wrote:

> "How can other users see my changes?" ...

> 'WHEN' should we use re-query in order to enable other user to see my
> changes ? every 30min ? 1 hour ?

        Only you can answer this.  Some people try to introduce mechanisms
(events, for example) to automatically requery whenever any user changes
a record, but this can become a real problem in a multiuser environment
with a lot of changes happening.  In our applications we don't do it
very often.  We run queries when absolutely necessary and buffer data
without trying to requery for changes while a screen is open.  If the
user wants to see changes from other users they can close and reopen the
screen.  This increases performance for everyone and works well with the
general case that most people are working on their own data and don't
care what others do.

Quote
> if many records need to make changes or many records need to insert in the
> database, so, how often we need to re-query ? re-query everytime before we
> press 'INSERT' ? will it slow down / insufficient to do so ?

        Performance depends upon the query and how many people are running it.  

        I won't recommend re-querying before each INSERT.  Instead just handle
the exception when your insert conflicts with someone elses.

        Many people like to re-read *the current record only* when the dataset
goes into edit mode.

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
We're hiring: http://www.vertexsoftware.com/careerops.htm#sd
     Delphi/InterBase WebLog: http://delphi.weblogs.com

Re:How can I refresh data in multi-user environment


Quote
In article <3c0b3452_1@dnews>, leebanc...@hotmail.com wrote...

Hi,

Quote
> 'WHEN' should we use re-query in order to enable other user to see my
> changes ? every 30min ? 1 hour ? coz other user may not know when we make a
> changes ...

Depends on your applications architecture.  Personally I never display
data to the user until they really need it, so I never need to refresh
(which isn't that good in a C/S environment).

J

Other Threads