Originally posted by Eduard Jodas:
Hi,
a question about lock/read/write/unlock sequence:
In order to first lock and then read a record we must first know the position of this record in the database. I see two choices here:
- keep the record number in the client an use it directly in the lock/read/write/unlock sequence
- perform a search first by primary key so the sequence would be: find/lock/read/write/unlock
Personally I don't like the first option because the record number is a low-level db issue the client should not be aware of. I have a Flight class which contains all the data of a flight. I'd need to add a field with the record number to the Flight class, but this field is not related to a Flight ... not a technical problem a psichological one ...
On the contrary the second option is far less efficient and, at the last point, also needs to deal with the record number.
Which option did you choose?
Regards,
Jim
SCJP, SCJD, SCWCD, SCEA Part I
Originally posted by Mark Spritzler:
Or if you look closely to the Data class, you will find the "find" method accepts a string, which is the flight number which the JTable knows, because it is the first column.
Mark
Regards,
Jim
SCJP, SCJD, SCWCD, SCEA Part I
Originally posted by Mark Spritzler:
Or if you look closely to the Data class, you will find the "find" method accepts a string, which is the flight number which the JTable knows, because it is the first column.
Mark
Something about .... going for a swim. With this tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|