ObjectDB ObjectDB

How to open a running db in ObjectDB Explorer?

#1

Hi! I've just discovered that I can't see the content of a database while it's in use.

Is there any way in which I could do that? It's not nice at all to close the application, copy the db in another location, start the application then finally I could explore my data, but it will be just a copy of the data, not the live information.

* I forgot to mention that the db is used in embedded mode.

edit
delete
#2

There are two possible solutions.

You can switch from embedded mode to client-server mode. Unlike embedded mode, client server mode supports accessing a database concurrently from multiple processes (embedded mode supports concurrently only within a JVM, i.e. multithreading, but not accessing the database from different processes / JVMs).

Alternatively you may try a new undocumented feature of ObjectDB, embedded-server mode. Enable it just by adding the <embedded-server> element to your objectdb.conf file:

<server>
  <connection port="6136" max="0" />
  <data path="$objectdb/db" />
  <embedded-server enabled="true" />

When enabled, embedded mode runs automatic server at the background, and any attempt to access the database while it is open in embedded mode is automatically routed to that server in client-server mode.

ObjectDB Support
edit
delete
#3

That's really cool. It works! Thank you very much.

You should definitely document this feature. ;)

edit
delete
#4

Unlike embedded mode, client server mode supports accessing a database concurrently from multiple processes (embedded mode supports concurrently only within a JVM, i.e. multithreading, but not accessing the database from different processes / JVMs).

So, if I have 1 physical server with:

1 JVM

1 Tomcat

which hosts 2 different webapps

1 ObjectDB server, in embedded server mode

Could you confirm that both webapps would be able to access ObjectDB in true embedded mode?

Or only 1st webapp in embedded mode and 2nd one - in client/server mode?

Thanks.

edit
delete
#5

This has not been checked by us so if you try please update.

It seems that it is unlikely to succeed if each web application includes its own copy of the objectdb.jar, but may succeed (i.e. both web applications will access their databases in embedded mode) depending on the web server, if the objectdb.jar is shared at the server level.

ObjectDB Support
edit
delete
#6

Hi,

I am getting the following error when trying to open a database:

"Attempt to open an database file that is currently in use by another process"

is <embedded-server enabled="true"/> still working for ObjectDB 2.6.8_02 ???

edit
delete
#7

Have you followed the instructions on #2 above?

It should work if configuration is properly set in the right configuration file (i.e. the configuration file that is actually used by ObjectDB).

ObjectDB Support
edit
delete
#8

Hi,

I think, I followed the instructions.

Here is how my configuration looks like:

<server>
    <connection port="6136" max="0" />
    <data path="$objectdb/db" />
    <embedded-server enabled="true"/>
  </server>

It is the same as what is shown in #2

edit
delete
#9

Please verify that both the application and the Explorer uses this specific objectdb.conf file.

ObjectDB Support
edit
delete
#10

Hi,

The application is deployed on Glassfish 4.1.1

I set a JVM option to specify the ObjectDB home directory which is "objectdb-2.6.8_02".

The database was created successfully in the db subdirectory.

The bin directory contains all relevant jar files including objectdb.jar which contains another configuration file.

May be, this is the cause of the problem!

The explorer requires objectdb.jar to run!

May be, it uses the configuration file which is packaged within objectdb.jar

Is it possible to tell the explorer which configuration file it should use ???

edit
delete
#11

See this manual page regarding the configuration file path.

ObjectDB Support
edit
delete
#12

Hi,

I finally started ObjectDB in Client-Server mode.

 

edit
delete

Reply

To post on this website please sign in.