joe lin

Greenhorn
+ Follow
since Dec 07, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by joe lin

hi paul and jon,
i think i will throw a runtime exception instead of returning a special value back to the caller. thanks both of you!
hi paul,
in my assignment,the methods do have exception declared in the signature,but
no IOException.i don't want to wrap IOException into other unrelative exception ,such as DuplicateKeyException. so,i want to find another way to solve this problem.
hi all,
Does this problem too easy to answer?! but it bother me! so give me a hand,pls. many thanks
hi all,
as my DBAccess interface haven't declared its methods to throw IOException,
but some of these methods do could thow such exception,so how should I do?
should I throw a runtime exception or return a specified value to the caller? I am go to submit my project, so ... many thanks!
hi Darya ,
the db file contains header data,schema data and some record datas.
you can't modify the header data and schema data,these data only provide you some information to handle the record datas.so you can modify the record datas.also ,you can replace the original db file with another db file
which has the same header data and same schema data with the original db file(the record datas can be different certainly).
hope this helps!
hi Frans,
thanks for your reply!
in my opinion,i don't think the cookieValue is used for security.
i think the cookieValue is only use for synchronize.so,as long as the cookieValue can perform the synchronized function well,it is enough!
do you think right?
hi Darya,


The original data file can be replaced by another data file.


replace the original data file with another data file?why?!

The data file format in a new datafile however remains the same.


the same as above.

The schema description section in a new data file can change.


you can't change the db file's schema,you only need to read out the schema and then handle the following data of the db file according to the achema.
hope this hleps!
hi all,
i am taking the B&C 2.2.1,and my DbAccess interface contains some methods require a long coolieValue as argument.so ,i want to use the record's row number as this cookieValue.because one record can be fetched by one client at a time,and one record's row number is exclusive in a db file.so one record's row number which get by client is also exclusive to one db file.
does this way work well?
any comments is grateful!
hi sean,
i think the option 2 is more performance.if you choose option 1,then every client search requires will lead to load the whole db file into memory,search in the memory,and then release the memory data just loaded.it is more expensive than persist the whole db file in memory just like your option 2 do.
another,one client just can lock one record at a time.so "lock all of the matching records for a request" will not happen.
hope this help!
hi Eric ,
did you expose the lock method to the client?if you did,and havn't do anything check inside the lock method,i think it is possible(when you are unguarded)to get the same lock by two clients.
hi Liang ,
I think you should read some materials about MVC.
the MVC pattern will tell you how to built a three-tiers application.
regards!
hi Steve ,
congratulation!your "locking" scroe is very high.so i think its implementation must be perfected.could you share this perfected implementation with us?
thanks!waiting for your reply.
hi Andrew,

Once line 6 has executed, the client has a reference to an instance of MyServer. If ever the client releases that reference (explicitly sets the variable server to null, or exits, or crashes) then Unreferenced will be called the next time the distributed garbage collector runs following the lease expiring.


the above is the real things that i want to know.
thanks for your explanation!
hi Andrew ,
after reading your above material,i want to ask you some questions:
1. if the client haven't accomplish the startClient function and died(i mean the client machine crash.suppose the server is running on another machine).so ,what will happend to the server?
2. if the client accomplish the startClient but unaccomplish the run function and died.also,what will happend to the server?
3. under the above two circs,would the server side's unreferenced function still be calld?why?
long for your replay.thanks in advance!
hi all,
I notice that there is a FileChannel clss in the jdk api.
and this class's javadoc comments:
Bytes may be read or written at an absolute position in a file in a way that does not affect the channel's current position.
does it mean we can do some concurrent access to a file using the file's
fileChannel without worrying about the file's file pointer?
i mean,if all the accesser use the file's fileChannel to access the file,
they will have the file's file pointer themselves?
hope your reply.