Recall the reason : Because OScheduler is running is separate threads. Pass the database object from the main thread which database initially created.

Each OScheduler thread holds a separate schedule job. The database will be set to its own thread in run function :
ODatabaseRecordThreadLocal.INSTANCE.set(db);