Sequence within additional data store

I replaced UniqueNumbers component in order to use different sequence names for different entities.

But now, I would like to use not only different sequence names, but sequences from the additional data store, not the main one. Is it possible, without rewriting the whole UniqueNumbers class?

Unfortunately, now you have to override quite a lot of methods to provide transactions and EntityManager for additional data store. I have created an issue to make this class more extension friendly.

Ok, thank you for the response. I will try to find some workaround for this.

However, your response triggered an interesting question - if I create an entity in additional data store, and the sequence is being created and used in the main data store - is it all in one single JTA transaction?

There are no global JTA transactions in CUBA, so transactions for different data stores are completely independent.

And that seems quite right. It would be far more complex otherwise. I implemented an entity listener that reads ID from sequence in the alternative data store. It is working fine. Thanks for your support.