Database is locked when in use

#1

I am oberving that when i reading anything from odbfiles, i am not allowed to copy and paste the odb files in the file system but the same i was able to do it in object db 1.0.

We supprt export functionality and if i am not allowed to copy it in objectdb 2.x, then its a problem for us :-(

Do you have any settings or other way to handle this?

#2

Using copy & paste to clone a database when it is in active use is unsafe.

With ObjectDB 2.x you should use online backup for this purpose.

ObjectDB Support
#3

Thanks for the reply.

I went through the online backup web page, it is mentioned for EntityManager. How do i achieve the same for PersistenceManager as I am using the JDO not JPA, and can you also please tell if i dont want the timestamp directory to be created, what extra needs to be done.

#4

You should be able to cast PersistenceManager to EntityManager.

In ObjectDB the same object is an instance of both interfaces.

ObjectDB Support
#5

Thanks. How should i get rid of Timestamp directory ? I am going to use the follwoing code

    query.setParameter("target", new java.io.File("c:\\backup"));

And i want all the odb files to be placed in "backup" directory not backup/[timestamp] directory.

#6

There is an undocumented parameter that you may try:

    query.setParameter("name", "your-dir-name");

 

ObjectDB Support
#7

Just to confirm for the usage of query.setParameter("name", "your-dir-name");

Is the second agruement a string <Dir Absolute path> or new File (diectory path);

 

#8

It should be a string, but since it is undocumented feature it might work only in a limited way (e.g. maybe only in embedded mode or only in client-server mode, etc.)

ObjectDB Support
#9

Unfortunately, query.setParameter("name", "your-dir-name"); is not working for me :-(

Now, i am using query.setParameter("target", new java.io.File("c:\\backup")); which works so far.

#10

OK. This is preferred anyway, since it is a documented parameter.

ObjectDB Support

Reply