Documentation ¶
Overview ¶
This plugin provides a database transaction to the application. A transaction is begun before each request and committed on success. If a panic occurred during the request, the transaction is rolled back. (The application may also roll the transaction back itself.)
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Db *sql.DB Driver string Spec string )
Functions ¶
This section is empty.
Types ¶
type DbPlugin ¶
type DbPlugin struct {
revel.EmptyPlugin
}
func (DbPlugin) AfterRequest ¶
func (p DbPlugin) AfterRequest(c *revel.Controller)
Commit the active transaction.
func (DbPlugin) BeforeRequest ¶
func (p DbPlugin) BeforeRequest(c *revel.Controller)
Begin a transaction.
func (DbPlugin) OnAppStart ¶
func (p DbPlugin) OnAppStart()
func (DbPlugin) OnException ¶
func (p DbPlugin) OnException(c *revel.Controller, err interface{})
Rollback the active transaction, if any.
Click to show internal directories.
Click to hide internal directories.