public class DBConnectionFilter extends AppControllerFilter
DBConfig class
of the application before controller is executed and will close it after.HttpSupport.HttpBuilder, HttpSupport.RenderBuilderLOGGER| Constructor and Description |
|---|
DBConnectionFilter()
This constructor is used to open all configured connections for a current environment.
|
DBConnectionFilter(String dbName)
Use this constructor to only open a named DB connection for a given environment.
|
DBConnectionFilter(String dbName,
boolean manageTransaction)
Use this constructor to only open a named DB connection for a given environment and specify
if this filter needs to manage transactions.
|
| Modifier and Type | Method and Description |
|---|---|
void |
after() |
void |
before() |
void |
onException(Exception e)
To be implemented by application level filters.
|
assign, blank, encoding, flash, flash, flash, flash, getEncoding, getFile, getHttpServletRequest, getHttpServletResponse, getMap, getMap, getRealPath, getRequestBytes, getRequestInputStream, getRequestStream, getRequestString, getResponseHeaders, header, header, jsonList, jsonMap, jsonMaps, locale, logDebug, logError, logError, logError, logInfo, logWarning, logWarning, merge, multipartForm, multipartForm, multipartFormItems, multipartFormItems, multipartFormItems, outputStream, outputStream, outputStream, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirect, redirectToReferrer, redirectToReferrer, render, respond, sanitize, sendCookie, sendCookie, sendFile, sendFile, sendPermanentCookie, session, session, sessionBoolean, sessionDouble, sessionFloat, sessionHas, sessionInteger, sessionLong, sessionObject, sessionString, setContentLength, setEncoding, setLocale, setRequestEncoding, setResponseEncoding, status, streamOut, uploadedFiles, uploadedFiles, uploadedFiles, values, view, view, view, writer, writerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappContext, context, cookie, cookies, cookieValue, exists, format, getId, getLocale, getRequestHost, getRequestPort, getRequestProperties, getRequestProtocol, getRoute, header, headers, host, ipAddress, ipForwardedFor, isDelete, isGet, isHead, isMethod, isMultipartContent, isPost, isPut, isXhr, locale, method, param, param, params, params, params, params1st, params1st, path, port, protocol, queryString, remoteAddress, remoteHost, requestHas, servletPath, session, session, uri, url, userAgent, xhrpublic DBConnectionFilter()
public DBConnectionFilter(String dbName)
dbName - name of DB to openpublic DBConnectionFilter(String dbName, boolean manageTransaction)
dbName - name of DB to openmanageTransaction - if set to true, the filter will start a transaction inside before() method,
commit inside the after() method, and rollback inside onException(Exception) method. This applies to
all connections managed by this filter. If set to false, transactions are not managed. Configuration of J2EE container transaction management
for a given JNDI DataSource can interfere with this filter. This filter uses simple java.sql.Connection methods:
setAutocommit(boolean), commit() and rollback(). If you configure XA transactions,
this parameter could be completely ignored by the container itself. For this filter to manage transactions, the
datasources should not be type of XA. Read container documentation.public void before()
before in class HttpSupportFilterpublic void after()
after in class HttpSupportFilterpublic void onException(Exception e)
HttpSupportFilteronException in class HttpSupportFiltere - exception.Copyright © 2022 JavaLite. All rights reserved.