Skip to content

tx:annotation-driven and cache:annotation-driven should have order defined as a token [SPR-10886] #15514

@spring-projects-issues

Description

@spring-projects-issues

Paul D Johe opened SPR-10886 and commented

It is not possible to use SPEL expressions to define the order of the aspect for both

  • <tx:annotation-driven />
  • <cache:annotation-driven />

This is because the xsd type is defined in the schema as a 'xs:int' type.

For example, a schema validation exception occurs if this is attempted:

<cache:annotation-driven order="${aop.cache.order}" />
<tx:annotation-driven order="${aop.transaction.order}" />

This fails as well:

<aop:advisor advice-ref="customizableTraceInterceptor" pointcut-ref="tracePointcut" order="${aop.trace.order}" />

as order is also defined as a 'xs:int' type and cannot use SPEL either.

The solution is to use xs:token instead of xs:int.

Note that the spring security definition has done this correctly and can be configured as such:

<security:global-method-security
		jsr250-annotations="disabled"
		secured-annotations="disabled"
		pre-post-annotations="enabled"
		order="${aop.security.order}">

See also previous issue #12001 where this feature was already asked for.


Affects: 3.2.4

Issue Links:

Referenced from: commits 12c393e

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions