s yucel

+ Follow
since Dec 04, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by s yucel

I should have written the class comments just before the class definition, otherwise it assumes like package comments. so it is ok now.

kind regards,

s. yucel
a sample code is as follows:

* Data is the class where the database file is mount and opened and
* @author Serkan YUCEL

package suncertify.db;

The problem is when I generate javadoc, it does not generate the comments which stays at the beginning of each class. I might be missing some options but I do not know.

kind regards,
Hi all,
having completing the comments in the applcation, I run the javadoc tool.But it does not seem to be generating the class/interface summary section at the top of the each class/interface. Does not it normally generate? or I am missing some parameter?

Secondly, I would like to write my design decisions in the document. Probably, I need to write why I choosed socket implementaion instead of RMI. The actaul reason is that I know the socket impl. very well. So what shoudl I write?

any idea highly appreciated.

kind regards,
i had the same problem, and I am thinking to use the thread id as it is a unique value.

kind regards,
Hi all,
i have set a mechanism for lock. I am appending the lock unlock and update method.
If anyone could give me a feedback it would be great as I have a limited time to finish the assignment.
thank you very much.

Lock code cut out

Kind regards,

Kind regards,
[ December 09, 2005: Message edited by: Barry Gaunt ]
Hi all,
I am implementing lock mechanism. My interface for update, lock and unlock is as follows:

// Modifies the fields of a record. The new value for field n
// appears in data[n]. Throws SecurityException
// if the record is locked with a cookie other than lockCookie.

public void updateRecord(long recNo, String[] data, long lockCookie)
throws RecordNotFoundException, SecurityException;

// Locks a record so that it can only be updated or deleted by this client.
// Returned value is a cookie that must be used when the record is unlocked,updated, or deleted. If the specified record is already locked by a different client, the current thread gives up the CPU and consumes no CPU cycles until the record is unlocked.

public long lockRecord(long recNo) throws RecordNotFoundException;

// Releases the lock on a record. Cookie must be the cookie
// returned when the record was locked; otherwise throws SecurityException.

public void unlock(long recNo, long cookie)
throws SecurityException;

Each thread will have access to the data class and its methods. From this interface, it seems that the thread will call updateRecord method with its ThreadID as a cookie, and I assume at the beginning of this update method, lock will be called and the record will be locked according to this threadID. However, the Lock method seems to be generating this cookie and send it back?
So I am a bit confused.
any idea is highlyappreciated

kind regards,
Hi all,
my assignment is going well. Bu some db points are confusing me.

1- In networked and standalone mode, the db file will be accessed. But in the assingment, there is not any clue about where this db file will reside?
I just wonder if it is under the working directory like properties file?
I assume the working directory is where we run the program using java.

2- I am using singleton pattern for Data.java, as the assignment says only one program will be accessing it. Am I right?

3- In the db interface, there is a cookie whic is generated by the lock method. How is this number generated?
And when updating a record, I should send the cookie parameter which was generated by the lock of the atomic operation?

4- My assignment shows the database file schema. I know how to use the data section as I will be playing on this section. But what about the first two section? I just wonder if I should use the two sections as well. If so how should I use them? The schema is as follows:

Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
4 byte numeric, total overall length in bytes of each record
2 byte numeric, number of fields in each record

Schema description section.
Repeated for each field in a record:
2 byte numeric, length in bytes of field name
n bytes (defined by previous entry), field name
2 byte numeric, field length in bytes
end of repeating block

Data section.
Repeat to end of file:
1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record
Record containing fields in order specified in schema section, no separators between fields, each field fixed length at maximum specified in schema information

End of file

any idea is highly appreciated.

Kind regards,

thank you very much for the quick response.
Still I am not sure what to do with IP address and port number.
So, if the examiner wants to run the server on a remote PC, then
initially, he needs to run the client GUI, change the IP address and PORT number , and then run the server on that remote pc. By the way, the client will get the address/port from the conf. files...Am I right with
all these things?
Actually I have one more question confusing me. I would like to clear.

java -jar <path+filename> mode
if mode==server , then just only the server will run,
if mode==alone then without server the client will run itself
if mode is empty then GUI will run and connect to the server ?
And the main class that directing to the proper classes will be defined
in the Manifest dir of the jar file called Main-Class:....?

any confirmation is highly appreciated

Kind regards,

Hi all,
I have chosen using plain socket and object serializtion. So, I will have a server socket running at the server side. My question is can I use a random port number and if it is already used? I am thinking to go on to the next port number until finding available one? Am I right or there is no need?
Also I am thinking to write the IP address and port number so that the client gets them to connect to the proper server socket?
can anybody please confirm me?
any idea highly appreciated
Kind regards,
Hi All,
I have just got my assignment, and I am a bit confused with some points:
My assignment is B&S.

1- The assigment has an interface to implement for data access. As far as I have understood, I need to provide two functionalities; Search and Book.
But in the interface, there are some methods to add a new record, to update and delete an existing record. Shall I implement these methods and put onto the GUI as well? And will there be unbook functionality?

2- In non networked mode, shall I suppose that only one client is accessing the db? In server mode, I need to implement all lcking mechanism as there are concurrent access. So I think I can use the same data access class for standalone mode as well?

any idea highly appreciated..
kind regards,