aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: If you use ByteBuffer, when do you store the data into disk? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX: If you use ByteBuffer, when do you store the data into disk?" Watch "NX: If you use ByteBuffer, when do you store the data into disk?" New topic
Author

NX: If you use ByteBuffer, when do you store the data into disk?

Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
The title is my question!
1. After each updata the buffer, or
2. At last before close the server?
Vlad Rabkin
Ranch Hand

Joined: Jul 07, 2003
Posts: 555
Hi Damu,
1. After each updata the buffer
The problem with 2. is that if your server crashes, all your updates will be lost.
Best,
Vlad
Bigwood Liu
Ranch Hand

Joined: Feb 26, 2003
Posts: 240
Hi Vlad, thank you for reply.
But it is too frequent for the server to do writing, if there are too many clients. How do you write the buffer to disk? I write the whole buffer to disk as following: I think buffer's advantage of fast operation is damaged if write the whole buffer to disk too often.
I had thought the problem of server crash. But when I rethink it, I was trapped in dilemma.
[ November 07, 2003: Message edited by: damu liu ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX: If you use ByteBuffer, when do you store the data into disk?