Class TransactionalRequest

java.lang.Object
io.jooby.ebean.TransactionalRequest
All Implemented Interfaces:
io.jooby.Route.Aware, io.jooby.Route.Filter

public class TransactionalRequest extends Object implements io.jooby.Route.Filter
Start a new transaction on each incoming request. Its commit the transaction is no exception is thrown or rollback in case of an exception.
Author:
edgar.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a transactional request.
    Creates a transactional request.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.jooby.Route.Handler
    apply(io.jooby.Route.Handler next)
     
    enabledByDefault(boolean enabledByDefault)
    Sets whether all routes in the scope of this decorator instance should be transactional or not (true by default).

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.jooby.Route.Aware

    setRoute

    Methods inherited from interface io.jooby.Route.Filter

    then, then
  • Constructor Details

    • TransactionalRequest

      public TransactionalRequest(String name)
      Creates a transactional request.

      This constructor should be used only if you have multiple Ebean installations.

      Parameters:
      name - Ebean service name.
    • TransactionalRequest

      public TransactionalRequest()
      Creates a transactional request.
  • Method Details

    • enabledByDefault

      public TransactionalRequest enabledByDefault(boolean enabledByDefault)
      Sets whether all routes in the scope of this decorator instance should be transactional or not (true by default).

      You can use the Transactional annotation to override this option on a single route.

      Parameters:
      enabledByDefault - whether routes should be transactional by default
      Returns:
      this instance
      See Also:
      • Transactional
    • apply

      public io.jooby.Route.Handler apply(io.jooby.Route.Handler next)
      Specified by:
      apply in interface io.jooby.Route.Filter