Hi Tiago, The DatabaseManager was replaced by the new Database Access Object (DAO) Layer in DSpace 6.x. So, now you need to use the appropriate DAO object to query the database table that you wish to query (as there are now DAOs for each database table). For much more information on this, see the DSpace 6 Service API notes at: https://wiki.duraspace.org/display/DSPACE/DSpace+Service+based+api#DSpaceServicebasedapi-Servicebasedapi (There are also many examples linked to from the bottom of that wiki page.)
So, there is no direct replacement for DatabaseManager. But, if you wanted to query the "item" table (for example), you'd now use the org.dspace.content.dao.ItemDAO class to do so: https://github.com/DSpace/DSpace/blob/master/dspace-api/src/main/java/org/dspace/content/dao/impl/ItemDAOImpl.java Hope that helps. If you have more specific questions, please feel free to ask them on this list. We fully realize this new model will take getting used to, but it provides much more stability and separation of concerns than our old way of using the DatabaseManager for all queries. Tim On Fri, Jan 20, 2017 at 5:36 AM Tiago Oliveira <[email protected]> wrote: > Ahoy! > > I'm haveing a really deep need to directly access database without using > Hibernate. I'm upgrading Dspace from Version 5 to 6, and in the older > version it was used a statistics module that ran independent queries ( i > really can't create an abstraction level with hibernate for that, since > every query is unique) > > Before the DB access was performed with Database Manager + TableRow but > now I cant do it that way since those classes no longer exist. I've already > tried to access the context -> getDbConnection -> getSession and get the > SQL connection through there. I've also tried with the > DSpaceServicesFactory to get the dataSource and then the connection. > > Both of this methods interfere with the hibernate access since I get an > invalid session after I've run any query to DB. > > Can anyone help me? > > Thanks in advance > > Tiago Oliveira > > -- > You received this message because you are subscribed to the Google Groups > "DSpace Technical Support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/dspace-tech. > For more options, visit https://groups.google.com/d/optout. > -- Tim Donohue Technical Lead for DSpace & DSpaceDirect DuraSpace.org | DSpace.org | DSpaceDirect.org -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
