can we have a query repository in the command handler?

Hi guys,
In our application, we designed some small aggregates, but still some business constraints should apply to those smaller aggregate, can I have a query repository in my command handler(or in the aggregate)?

Otherwise I will have a transaction open before I dispatch the command.

Keats

Hi Keats,

yes, that’s possible. If it’s undesirable to have the additional data as part of a command, it’s possible to use a repository to add that information in the command handler (or aggregate, if you prefer that type of design).

Cheers,

Allard

Hi,

there is a Wiki page that may answer your question:
http://code.google.com/p/axonframework/wiki/HowToEnhanceEvents

Cheers,
Michael

I migrated that page to the faq on the new website:
http://www.axonframework.org/category/faq/

Cheers,
Allard