cancel
Showing results for 
Search instead for 
Did you mean: 

how alfresco uses the ddbb connection?

dacedos
Champ in-the-making
Champ in-the-making
Hi,

I created some custom tables to audit,

I'd like to know how alfresco uses connections with database to avoid me a custom DAO and to avoid create a new connection everytime I want to write into tables.

How could I get the default database connection? because I am pretty sure alfresco connect when tomcat starts, I tried to track for example when creating a node because alfresco writes in tables but I do not know how it does.

thanks!
1 REPLY 1

derek
Star Contributor
Star Contributor
Take a look at the code
org.alfresco.repo.domain.schema.SchemaBootstrap
and how it gets hold of the connection from the SessionFactory.  Instead of
        Session session = getSessionFactory().openSession();
you would use
        Session session = getSessionFactory().getCurrentSession();