Last active
December 14, 2015 06:58
-
-
Save jhiemer/5046536 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void handleEvent(final Event event) throws OperationsException { | |
Object object = configurationTargetRepository | |
.findOne(event.getStateChangingEntity()); | |
Object objectOrigin = searchInOriginalDatabase(event); | |
createAndSaveEvent(event, object); | |
saveInTargetDatabase(event, objectOrigin); | |
} | |
} | |
@Transactional(value="txManagerBilling", propagation = Propagation.REQUIRES_NEW) | |
public void saveInTargetDatabase(final Event event, | |
Object object) { | |
// fliegt auf die Nase bei Lazy Loading | |
} | |
@Transactional(value="txManagerEvoila", propagation = Propagation.REQUIRES_NEW) | |
public Object searchInOriginalDatabase(final Event event) { | |
// funktioniert einwandfrei bei Lazy Loading | |
} | |
private void createAndSaveEvent(final Event event, | |
final Object object) { | |
ChargeBackEvent chargeBackEvent = new ChargeBackEvent( | |
UUID.randomUUID(), event.getEndDate(), | |
Object.class.getCanonicalName(), object.getId(), | |
Commands.DELETE); | |
chargeBackEventRepository.save(chargeBackEvent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment