ObjectDB ObjectDB

Drop in Client/server mode not working

#1

Hi, can't seem to get drop to work in c/s mode:

version: objectdb-2.3.5_04

config: <extensions drop="tmp" />

url: 'objectdb://localhost/testStorage1.tmp;drop;user=admin;password=admin'

 

suggestions?

David

 

edit
delete
#2

Just checked using the following simple test and it works (always prints 1):

import javax.persistence.Entity;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;


public class T627 {

    public static void main(String[] args) {
        EntityManagerFactory emf = Persistence.createEntityManagerFactory(
            "objectdb://localhost/testStorage1.tmp;drop;user=admin;password=admin");
        EntityManager em = emf.createEntityManager();

        em.getTransaction().begin();
        em.persist(new MyEntity());
        em.getTransaction().commit();
       
        System.out.println(
            em.createQuery("SELECT COUNT(e) FROM MyEntity e").getSingleResult());

        em.close();
        emf.close();

    }

    @Entity
    public static class MyEntity {
    }
}

 

ObjectDB Support
edit
delete
#3

Maybe your server configuration doesn't include tmp as a valid extension for drop?

ObjectDB Support
edit
delete
#4

I am using this:

<extensions drop="tmp" />

 

 

edit
delete
#5

I tried your example at it works as long as the Explorer is not connected to the database.

ie: If explorer is connected to a c/s database then it is not dropped!

I confirmed this with my code.

In my view, this is a bug in the drop feature, as it's important to be able to have the explorer open during testing.

David

edit
delete
#6

Drop is possible only for a database that is currently not open and in use.

The Explorer is like any other database user so a database cannot be deleted while it is open and in use by the Explorer.

You may fill a feature request if you think that this behavior should be changed.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.