Could you please tell me what is the correct way to make orientDB
connection pool?
I'm trying something like this, but it's doesn't work.
import com.orientechnologies.orient.core.exception.OStorageException;
import com.orientechnologies.orient.object.db.OObjectDatabasePool;
import com.orientechnologies.orient.object.db.OObjectDatabaseTx;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class AppServletContextListener implements ServletContextListener {
private OObjectDatabaseTx dbPool = null;
@Override
public void contextInitialized(ServletContextEvent sce) {
// OGlobalConfiguration.STORAGE_KEEP_OPEN.setValue( false );
try {
OObjectDatabaseTx db =
OObjectDatabasePool.global().acquire("local:c:/tmp/odb", "admin", "admin");
} catch (OStorageException exc) {
dbPool = new OObjectDatabaseTx("local:c:/tmp/odb");
dbPool.create();
}
dbPool.getEntityManager().registerEntityClasses("pojo");
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
if (dbPool != null && !dbPool.isClosed()) {
dbPool.close();
}
}
}
with
<listener>
<listener-class>AppServletContextListener</listener-class>
</listener>
in web.xml
I'm using GlassFish. I also tried to connect using Connectior connecting
pool and glassfish-resources.xml, but with no success too:(
What's the correct way to get conncetion pool, and than to get thread for
use in application response?
Maybe you could send me a working example if you already have one? ( my
mail: [email protected] )
best regards
Tomek
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.