Originally posted by Andrew Monkhouse:
Why are you reloading the contractor within the while loop:
Originally posted by Andrew Monkhouse:
Why are you generating the lock cookie inside your synchronized block?
If you do get an InterruptedException, the code which called the lockRecord() method will get back a lockCookie - is this reasonable?
1.I am not sure if my implementation to open the RandomAccessFile is ok.
I have a separate class, DataInfo with only static variablen and methods to read the lenght of fields, header etc. I have also a static getRaf() method
witch returns new RandomAccessFile(dbFile, "rw"); I use this method every time I need the raf.
My find method returns the records depending on the exactMatch flag. The default is true. I have another constructor in the Data class with an additional boolean parameter to can set the exactMatch to false. In the case that the client will be later extended to search for inexact matches, than this constructor has to be used. Is this OK?
// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public long[] findByCriteria(String[] criteria);
3. It is necessary to implement the create and delete methods? In GUI I don't need them. For the update method I have to update besides the owner field also the other fields? It is possible only to update the owner.
,your implementation of the DBAccess interface should be according to the method comments provided in the interface
A data access system called Data that provides record locking and a flexible search
mechanism
Let's draw a chart:
code:
--------------------------------------------------------------------------------
Client says "Give me data" --RMI--> Business Methods --> Data --> Database representation.
--------------------------------------------------------------------------------
Does the above diagram conflict with the use of the phrase " 'top level' features"? Or would
the following diagram be more accurate?
code:
--------------------------------------------------------------------------------
Client says "Give me data" --RMI--> Data --> Database representation
--------------------------------------------------------------------------------
Or do both diagrams make sense?