File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java NIO in B&S

 
Samuel Ittera
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was reading the instructions of my assignment, and it does not restrict me from using java.nio. This makes life a whole lot easier ( I am glad I do not need to re-invent the wheel ).

1. I can use a file channel for every record.
2. The locking/unlocking feature is already built in with FileLock.
3. I don't see any need to cache, because I can directly map a ByteBuffer to a single record in the database file.

Can someone give me a reason not to go down this path.

Thank you,
Samuel Ittera SCJP 1.4
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Referring to your second point: how do you get around this (from the FileLock API)?

File locks are held on behalf of the entire Java virtual machine. They are not suitable for controlling access to a file by multiple threads within the same virtual machine.
 
mmg
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From http://www.sun.com/training/catalog/courses/CX-310-252A.xml :

The following APIs and facilities may not be used:

* Enterprise JavaBeans
* Servlets, JSP technology, or any other web-oriented APIs
* NIO, the New IO facilities
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic