@Target(value=METHOD) @Retention(value=RUNTIME) public @interface Transactional
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
decorator(s).
Modifier and Type | Fields and Description |
---|---|
static String |
ATTRIBUTE
Constant to use as attribute name for script routes.
|
Modifier and Type | Optional Element and Description |
---|---|
boolean |
value
Whether to enable or disable
TransactionalRequest for the annotated route. |
public static final String ATTRIBUTE
{
get("/", ctx -> ...).attribute(Transactional.ATTRIBUTE, true);
}
Copyright © 2021. All rights reserved.