try {
ClientHandle[] clients=null;
if (this.fileLock.rafile.length()>0) {
- ObjectInputStream is = new ObjectInputStream(new BufferedInputStream(
- new java.io.FileInputStream(sessionFile)));
+
+ ObjectInputStream is = new ObjectInputStream(fileLock.getBufferedInputStream(true));
Object o;
o=is.readObject();
if (o!=null) {
File templist = backupSessionFile();
if (templist != null) {
try {
- fileLock.rafile.setLength(0);
- ObjectOutputStream os = new ObjectOutputStream(
- new BufferedOutputStream(new FileOutputStream(this.sessionFile)));
+ // fileLock.rafile.setLength(0);
+ ObjectOutputStream os =
+ new ObjectOutputStream(fileLock.getBufferedOutputStream(true));
+
+// new BufferedOutputStream(new FileOutputStream(this.sessionFile)));
+ // new BufferedOutputStream(new FileOutputStream(this.fileLock.rafile.getFD())));
os.writeObject(clients);
- os.close();
+ os.close(); // close destroys lock!
// All done - remove the backup.
templist.delete();
templist = null;