On Wed, 11 Nov 2009, Mindaugas Kavaliauskas wrote:

Hi,

> >>AGAIN
> >>To open a table concurrently in multiple work areas, you can do one of
> >>the following:
> >>Select another work area and issue USE with the table name and the AGAIN 
> >>clause.
> >>Issue USE with the table name and the AGAIN clause, and specify a
> >>different work area with the IN clause.
> >>When you open a table again in another work area, the table in the new
> >>work area takes on the attributes of the table in the original work
> >>area. For example, if a table is opened for read-only or exclusive
> >>access and is opened again in another work area, the table is opened
> >>for read-only or exclusive access in the new work area.
> I do not see a big problem here:
> DBUSEAREA(.T., RDDNAME(), DBINFO(DBI_FULLPATH), cNewArea,
> DBINFO(DBI_SHARED), DBINFO(DBI_ISREADONLY))

Please remember that in Clipper and Harbour it's possible to disable
alias by using explicitly empty string "" as alias what effectively
resolves the problem with alias conflicts and in above example can be
used instead of cNewArea.

Anyhow this will not allow to reoopen table open in exclusive mode in
other workarea.

> >>In Visual FoxPro for Windows, opening a table again in another work
> >>area doesn't consume an additional file handle.
> 
> This will be not true in Harbour, but do you really care.

In Harbour it's platform dependent behavior. In *nix systems when the
same table, memos or indexes are open more then once then file handles
are shared. It's part of default filebuf.c code and it's necessary to
sync locks between aliased work areas and resolved some other problems
which can appear in POSIX systems.
In the future it will be used also for file caches and pseudo exclusive
mode (exclusive mode for external programs but shared between threads)
which should be quite interesting feature for programs like remote DB
servers.

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to