[url]Olnex.net[/url]
[SCJP 1.2, SCJD, SCWCD]
1.Can the find(String [] criteria) method return a deleted record?
2.Can the update(int recNo, String [] data) method update a deleted record?
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by HaoZhe XU:
1.Can the find(String [] criteria) method return a deleted record?
2.Can the update(int recNo, String [] data) method update a deleted record?
if not, should I throw RecordNotFoundException?
Originally posted by HaoZhe XU:
2.Can the update(int recNo, String [] data) method update a deleted record?
Originally posted by Javini Javono:
It depends how you end up defining your method, and how all the methods will make sense together. My ideas are presumably not mainstream, but theoretically, I would think it could, as it might change the deleted flag to undeleted or vice versa.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
To give you an impossible question:
Record number 5 contains the value "Sams business"
Client 1 deletes record number 5
Client 2 adds a new record "Bills business" which happens to overwrite record 5
Client 3 searches for all records matching "Bill" and gets record number 5
Client 1 does an update which is designed to "undelete" record 5
Now what happens? Client 1 believes it is working with record 5 = "Sams business" and client 3 believes it is working with record 5 = "Bills Business". Who is right?
It is only if a record is totally discarded when it is deleted that you can avoid that conundrum
Regards, George
SCJP, SCJD, SCWCD, SCBCD
To give you an impossible question:
Record number 5 contains the value "Sams business"
5: Active: "Sams business"
Client 1 deletes record number 5
5: Inactive: "Sams business"
Client 2 adds a new record "Bills business" which happens to overwrite record 5
5: Active: "Bills business"
Client 3 searches for all records matching "Bill" and gets record number 5
Agreed.
Client 1 does an update which is designed to "undelete" record 5
Illegal: record 5 is already "undeleted".
Now what happens? Client 1 believes it is working with record 5 = "Sams business" and client 3 believes it is working with record 5 = "Bills Business". Who is right?
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|