Useful together with the various route decorators like
TransactionalRequest
provided by
extensions jooby-hibernate
, jooby-jdbi
or jooby-ebean
to toggle it's
effect for a single route.
Although TransactionalRequest
is configured to be enabled by default, for a route
method annotated with @Transactional(false)
it won't take effect.
Similarly, if the decorator is disabled by default, a for route method annotated with
@Transactional(true)
it will take effect.
Use the ATTRIBUTE
constant for script routes instead of the annotation itself:
{
get("/", ctx -> ...).attribute(Transactional.ATTRIBUTE, true);
}
This annotation has no effect on the behavior of SessionRequest
use(s).
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
Whether to enable or disableTransactionalRequest
for the annotated route. -
Field Summary
-
Field Details
-
ATTRIBUTE
Constant to use as attribute name for script routes.{ get("/", ctx -> ...).attribute(Transactional.ATTRIBUTE, true); }
-
-
Element Details
-
value
boolean valueWhether to enable or disableTransactionalRequest
for the annotated route.- Returns:
- value to toggle
TransactionalRequest
- Default:
- true
-