ObjectDB ObjectDB

unable to update table in slave server database

#1

Hi,

We are facing below issue in objectdb clustering. Currently in objectdb clustering when master server is down ,in slave server during update operation in table getting below issues.

Failed to commit transaction: Attempt to commit a transaction in read only mode[ObjectDB 2.8.2] javax.persistence.RollbackException
Failed to commit transaction: Attempt to commit a transaction in read only mode (error 613)
        at com.objectdb.jpa.EMImpl.commit(EMImpl.java:180)
        at code.db.jpa.oodb.ObjDBem.doCommitInsert(ObjDBem.java:75)
        at code.db.jpa.oodb.ObjDBem.Update(ObjDBem.java:224)

This is the configuration done in objectdb configuration file.

<database>
    <size initial="256kb" resize="256kb" page="2kb" />
    <recovery enabled="true" sync="true" path="." max="128mb" />
    <recording enabled="true" sync="true" path="." mode="write" />
    <locking version-check="true" />
    <processing cache="64mb" max-threads="10" />
    <query-cache results="32mb" programs="500" />
    <extensions drop="temp,tmp" memory="mem" />
</database>

Any help would be greatly appreciated.  Thanks!

edit
delete
#2

In ObjectDB clusters slave databases are read only (see this documentation page). This is useful mainly for load balancing (by directing read operations to slaves) and backup.

The automatic switch from the master to the slave is therefore also limited to READ ONLY mode, and can only provide limited functionality until the master is up again. The reason for this is that the synchronization is always in one direction, i.e. the slave is updated by the master, updating the slave will break synchronization when the master starts again.

If you want, you may make the switch between the slave and the master by your application, by connecting to the slave directly and changing the roles of the master and the slave, as currently there is no built support for this in ObjectDB.

ObjectDB Support
edit
delete
#3

Hi,

We have tried to use by changing roles of the master and the slave database. As slave database is storing data in replication path ,while we are giving replication url as master database facing same issue while trying to modify it. 

Let us know is there any other solution to handle it so that we can able to read and write in the slave database also.

 

Any help would be greatly appreciated.  Thanks!!

 

edit
delete
#4

Yes, it may require some extra work, but you can also move the master and slave database files to new paths, if needed, generate new copies, etc. (externally to ObjectDB by manipulating the file system from the application).

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.