public final class CmsDbContext extends CmsDbContext
Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManager |
m_entityManager
The EntityManager instance for this context.
|
protected boolean |
m_shouldCommit
Tells when the current transaction should be commit or rollback.
|
m_attributes, m_flexRequestContextInfo, m_projectId, m_requestContext
Constructor and Description |
---|
CmsDbContext()
Creates a new, empty database context.
|
CmsDbContext(CmsRequestContext context)
Creates a new database context initialized with the given user request context.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears this database context.
|
javax.persistence.EntityManager |
getEntityManager()
Returns the entity manager of this db context.
|
void |
report(I_CmsReport report,
CmsMessageContainer message,
java.lang.Throwable throwable)
Reports an error to the given report (if available) and to the OpenCms log file.
|
void |
rollback()
Rollback current transaction and starts new.
|
currentProject, currentUser, getAttribute, getFlexRequestContextInfo, getHistoryDriver, getProjectDriver, getProjectId, getRequestContext, getUserDriver, getVfsDriver, isDefaultDbContext, pop, removeAttribute, removeSiteRoot, setAttribute, setProjectId, throwException
protected javax.persistence.EntityManager m_entityManager
protected boolean m_shouldCommit
public CmsDbContext()
public CmsDbContext(CmsRequestContext context)
context
- the current users request contextpublic void clear()
clear
in class CmsDbContext
public javax.persistence.EntityManager getEntityManager()
public void report(I_CmsReport report, CmsMessageContainer message, java.lang.Throwable throwable) throws CmsVfsException, CmsException
report
in class CmsDbContext
report
- the report to write the error tomessage
- the message to write to the report / logthrowable
- the exception to write to the report / logCmsException
- if the throwable parameter is not null and a CmsExceptionCmsVfsException
- if the throwable parameter is not null and no CmsExceptionpublic void rollback()
rollback
in class CmsDbContext