Re: [VisualAge] Long lists in Client/Server application



Thanks for the reply.

Yes, being able to skip to the right record would be perfect. I didn't see
any
easy way to do that without actually fetching every row along the way,
though.
And this may eventually take quite a while to do. Certainly better than
reconstituting all the objects at once though (I have my own
object-relational
mapping framework). In an ideal world, I would be able to ask the cursor to
skip to a certain point, as you would do with a Stream, but I couldn't see
any
way to do that.

Julian

"Yanni Chiu" <yanni-REMOVETHIS@xxxxxxxxxx> wrote in message
news:nZKdnU5-1ozw3nfenZ2dnUVZ_sqdnZ2d@xxxxxxxxxxxxxxxxxxxxx
Julian Ford wrote:
Well, currently I am using Access (yeah, I know! But it's quick during
development),
but I will be rolling out using PostgreSQL. Perhaps, if it IS a database
limitation, I
should switch over now to see if I have the same issue on PostgreSQL.

PostgreSQL definitely has the transaction isolation so two
different connections will not interfere. However, if the
data access framework (i.e. VA code) doesn't allow you to
have more than one active connection (one for the query cursor
and one for the separate update), then the database wouldn't
the problem.

Assuming the database has the necessary isolation, you now
have a different problem. If the update were to insert a new
item that the user expects to see in the list immediately, then
your cursor is invalid from an application behaviour point
of view, even though the database could keep the two transactional
contexts separate.

But otherwise, you are exactly right...my search view is invalidated
because the
database cursor is lost over on the server. I certainly COULD resubmit
the
query, but I can't see any easy way to position the the cursor at the
correct point

A few years back I did something like:
- keep track of the record index (had this for free
since it was needed for next/prev links on the
web interface)
- rerun the query, skip to the index, check that
it is the same record previously selected. If not
then check the next one, because a new record
was inserted earlier in the list. If the next one
isn't the expected one, then give up because too
much has changed.

There were only expected to be about 10 users on the
system, and not even simultaneously doing similar tasks
(i.e. adding new people). So the list would rarely change.
YMMV.

--
Yanni Chiu


.



Relevant Pages

  • Re: Populating a Pull-Down
    ... you are also forcing ADO to make a second trip to the database ... Why open a less-efficient static cursor? ... I'm surprised you are not getting an error from "User Query". ... This line is not necessary, and in fact, may cause the recordset to be ...
    (microsoft.public.scripting.vbscript)
  • Re: MSforeachdb question
    ... Could you use a cursor to iterate through the databases. ... following code to query the databases and put the data into a temporary ... DECLARE cDataBases CURSOR ... WHERE name like 'ABC%' -- you may want to filter some database names ...
    (microsoft.public.sqlserver.server)
  • Re: database persistence with mysql, sqlite
    ... records without reestablishing a database connection every time I ... left from the initial query. ... open cursor can lock-out writers, ... mod_python (Python Server Pages under Apache). ...
    (comp.lang.python)
  • Re: Compare 2 database queries?!
    ... > puts protein data from the query into a PostgreSQL table. ... > what I would like it to do is check if the protein is in my database ... But as far as I can tell, PostgreSQL doesn't support such a construct, ...
    (perl.beginners)
  • Re: Sort by Month/Year
    ... Does the cursor jump somewhere else? ... semicolon to see if there's any invisible invisible characters. ... an indication of database file corruption. ... create an entirely new query. ...
    (microsoft.public.access.queries)