All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.util.Dictionary | +----java.util.Hashtable | +----java.util.Properties | +----interbase.interclient.ConnectionProperties
This class is used to tailor connection properties before attaching to an InterBase database.
public ConnectionProperties()
public void setUser(String user, String password) throws SQLException
public void setExclusiveAccess(boolean exclusive) throws SQLException
public void activateShadow(boolean activate) throws SQLException
public void reserveNoSpaceForVersioning(boolean noreserve) throws SQLException
The default is to reserve space for back versions in a database. It's only if the database is mostly archival (read only loosely-speaking) that no reserve space is recommended.
public void allowAsynchronousDiskWrites(boolean asynchronous) throws SQLException
The default for Unix is asynchronous and for NT it is synchronous. I think it's this way because it was thought people with PCs power off their machines whereas Unix users usually perform an orderly shutdown.
There are two significant shortcomings of using asynchronous writes:
So there are risks for database corruption if async writes are being used. The window of risk is the amount of time it takes your OS to write pages to disk once we have written them out to the OS cache. While this may seem like a small window, imagine a system under full load, pages being constantly updated. At any given time you may lose power, and certain pages will not be written out, or even worse pages may be written which expect the presence of other pages.
Sometimes the loss of a page is easily recoverable, such as when a new record is added to a data page. You will merely lose that new record. Other times the damage could be more severe. Some things can be fixed by gfix -mend. If that doesn't work, sometimes data can be recovered from a damaged database by copying it to another database one table at a time. But you do have to face the possibility of complete non-recovery of the database, though this is relatively rare.
So to be safe, those using asynchronous write should use a UPS, or at the very least take a backup once a day and be prepared, in the worst case, to lose that day's changes.
public void enableStructureVerification(boolean verify) throws SQLException
If the database structures are not verifiable then a SQLException will be thrown when the connection is attempted.
public void setCacheBuffers(int num) throws SQLException
This is a transient property of the connection and is overridden by the database-wide default set by Server.setCacheBuffers(database), but takes precedence over the server-wide default set by ServerProperties.setDefaultCacheBuffers().
On SuperServer, if a database cache already exists due to another attachment to the database then the cache size may be increased but not decreased.
Note: This method may be deprecated because it jeopardizes the performance of the server. An arbitrary user can connect and reserve 200MB for foo.gdb while corporate.gdb is forced to accept less.
All Packages Class Hierarchy This Package Previous Next Index