diff --git a/include/object-db-file.h b/include/object-db-file.h
index fb9ca91..daa2193 100644
--- a/include/object-db-file.h
+++ b/include/object-db-file.h
@@ -8,8 +8,10 @@
 #include <ofstream>
 #include <sstream>
 #include <boost/thread/locks.hpp>
-#include <boost/thread/recursive_mutex.hpp>
 #include <boost/lexical_cast.hpp>
+#include <boost/interprocess/sync/file_lock.hpp>
+#include <boost/interprocess/sync/sharable_lock.hpp>
+#include <boost/interprocess/sync/scoped_lock.hpp>
 
 #define _OVERRIDE
 #ifdef __GNUC__
@@ -38,9 +40,9 @@
 class ObjectDBFile
 {
 public:
-  typedef boost::shared_mutex Lock;
-  typedef boost::unique_lock<Lock> WriteLock;
-  typedef boost::shared_lock<Lock> ReadLock;
+  typedef boost::interprocess::file_lock Filelock;
+  typedef boost::interprocess::scoped_lock<Filelock> WriteLock;
+  typedef boost::interprocess::sharable_lock<Filelock> ReadLock;
 
   ObjectDBFile(const string &filename);
   virtual ~ObjectDBFile(){}
@@ -91,10 +93,6 @@
   rewind();
 
 protected:
-  // write lock should have been grabbed already before the call
-  void
-  prepareWrite();
-
   // read or write lock should have been grabbed already before the call
   void
   checkInit(const string &msg);
@@ -109,8 +107,7 @@
   string m_filename;
   ifstream m_istream;
   ofstream m_ostream;
-  Lock m_lock;
-  bool m_writable;
+  Filelock m_filelock;
   bool m_initialized;
   // capacity in terms of number of COs
   int m_cap;
diff --git a/src/object-db-file.cpp b/src/object-db-file.cpp
index ae13d91..d294b23 100644
--- a/src/object-db-file.cpp
+++ b/src/object-db-file.cpp
@@ -23,12 +23,15 @@
                 , m_cap(0)
                 , m_index(0)
                 , m_initialized(false)
-                , m_writable(false)
                 , m_filename(filename)
+                // This ensures file with filename exists (assuming having write permission)
+                // This is needed as file_lock only works with existing file
+                , m_ostream(m_filename, ios_base::binary | ios_base::app)
+                , m_istream(m_filename, ios_base::binary | ios_base::in)
+                , m_filelock(m_filename)
 {
-  m_istream.open(m_filename, ios_base::binary);
   int magic;
-  ReadLock(m_lock);
+  ReadLock(m_filelock);
   readInt(m_istream, magic);
   if (magic == MAGIC_NUM)
   {
@@ -42,26 +45,18 @@
 ObjectDBFile::~ObjectDBFile()
 {
   m_istream.close();
-  if (m_writable)
-  {
-    m_ostream.close();
-  }
+  m_ostream.close();
 }
 
 void
 ObjectDBFile::init(int capacity)
 {
-  WriteLock(m_lock);
+  WriteLock(m_filelock);
   if (m_initialized)
   {
     throwException("Trying to init already initialized ObjectDBFile object" + m_filename);
   }
 
-  if (!m_writable)
-  {
-    prepareWrite();
-  }
-
   m_cap = capacity;
   m_size = 0;
 
@@ -92,14 +87,9 @@
 void
 ObjectDBFile::append(const Bytes &co)
 {
-  WriteLock(m_lock);
+  WriteLock(m_filelock);
   checkInit("Trying to append to un-initialized ObjectDBFile: " + m_filename);
 
-  if (!m_writable)
-  {
-    prepareWrite();
-  }
-
   if (m_size >= m_cap)
   {
     throwException("Exceed Maximum capacity: " + boost::lexical_cast<string>(m_cap));
@@ -156,7 +146,7 @@
 int
 ObjectDBFile::fSize()
 {
-  ReadLock(m_lock);
+  ReadLock(m_filelock);
   updateSize();
   return m_size;
 }
@@ -164,14 +154,14 @@
 int
 ObjectDBFile::index()
 {
-  ReadLock(m_lock);
+  ReadLock(m_filelock);
   return m_index;
 }
 
 bool
 ObjectDBFile::seek(int index)
 {
-  ReadLock(m_lock);
+  ReadLock(m_filelock);
   updateSize();
   if (m_size <= index)
   {
@@ -188,7 +178,7 @@
 void
 rewind()
 {
-  ReadLock(m_lock);
+  ReadLock(m_filelock);
   m_index = 0;
   // point to the start of the CO fields
   m_istream.seekg( (3 + m_cap) * sizeof(int), ios::beg);
@@ -202,21 +192,3 @@
     throwException(msg);
   }
 }
-
-void
-ObjectDBFile::prepareWrite()
-{
-  ios_base::openmode mode = ios_base::app | ios_base::binary;
-  // discard any content if the object is considered uninitialized
-  if (!m_initialized)
-  {
-    mode |= ios_base::trunc;
-  }
-
-  m_ostream.open(m_filename, mode);
-  m_writable = m_ostream.is_open();
-  if (!m_writable)
-  {
-    throwException("Unable to open file for write: " + m_filename);
-  }
-}
