Skip to content

Transaction synchronization hook - beforeCreatePhase [SPR-13724] #18297

@spring-projects-issues

Description

@spring-projects-issues

David J. M. Karlsen opened SPR-13724 and commented

Looking at

http://docs.spring.io/autorepo/docs/spring/3.2.5.RELEASE/javadoc-api/org/springframework/transaction/support/TransactionSynchronization.html

and https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/transaction/event/TransactionalEventListener.html / https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/transaction/event/TransactionPhase.html

it would be nice to have a new phase BEFORE_CREATE - emitted by the framework just before it calls the underlying resource to create a new transaction.

The reason for this is that we need to initialize https://www-01.ibm.com/support/knowledgecenter/SSTVLU_8.6.0/com.ibm.websphere.extremescale.javadoc.doc/topics/com/ibm/websphere/objectgrid/spring/SpringLocalTxManager.html
with an ObjectGrid instance (kept threadlocal inside that implementation) just before it will be called by spring to get one.

We do this today by composing a custom annotation (annotated again with @Transactional) and intercepting execution with an aspect - but it would be nice to put it directly into framework classes - and I guess it could be interesting for other usecases as well.


Issue Links:

1 votes, 3 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: dataIssues in data modules (jdbc, orm, oxm, tx)status: invalidAn issue that we don't feel is validtype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions