How can I provide TransactionManager while using additional DataStore?

Hi guys,

I introduced a 2nd data source for my jmix for a different screen using dynamoDB on AWS.

I think I managed to have a secondary data manager,


I’m stuck providing this TransactionManager;

return applicationContext.getBean(storeName + "TransactionManager", PlatformTransactionManager.class);

It looks up for my TransactionManager but I don’t have any and I don’t know how to provide it.

Could you please help me or share with me any opinion?

App starts up successfully, only throws exception when I tried to open the new screen which is using the additional data store that is dynamoDB.

I’d appreciate any help.

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘admin_dynamoDBDataStoreTransactionManager’ available
at ~[spring-beans-5.3.18.jar:5.3.18]
at ~[spring-beans-5.3.18.jar:5.3.18]
at ~[spring-beans-5.3.18.jar:5.3.18]
at ~[spring-beans-5.3.18.jar:5.3.18]
at ~[spring-context-5.3.18.jar:5.3.18]
at io.jmix.core.impl.TransactionManagerLocator.getTransactionManager( ~[jmix-core-1.2.2.jar:na]
at ~[jmix-data-1.2.2.jar:na]
at io.jmix.eclipselink.impl.JpaDataStore.beginLoadTransaction( ~[jmix-eclipselink-1.2.2.jar:na]
at io.jmix.core.datastore.AbstractDataStore.loadList( ~[jmix-core-1.2.2.jar:na]
at io.jmix.core.impl.UnconstrainedDataManagerImpl.loadList( ~[jmix-core-1.2.2.jar:na]
at io.jmix.ui.model.impl.CollectionLoaderImpl._load( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.model.impl.CollectionLoaderImpl.load( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.component.dataloadcoordinator.OnFrameOwnerEventLoadTrigger.load( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.component.dataloadcoordinator.OnFrameOwnerEventLoadTrigger.lambda$new$0( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.core.common.event.EventHub.publish( ~[jmix-core-1.2.2.jar:na]
at io.jmix.ui.screen.Screen.fireEvent( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.screen.UiControllerUtils.fireEvent( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.sys.ScreensImpl.fireScreenBeforeShowEvent( ~[jmix-ui-1.2.2.jar:na]
at ~[jmix-ui-1.2.2.jar:na]
at ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.navigation.navigationhandler.ScreenNavigationHandler.openScreen( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.navigation.navigationhandler.ScreenNavigationHandler.navigate( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.navigation.navigationhandler.ScreenNavigationHandler.doHandle( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.navigation.ScreenNavigator.handleScreenNavigation( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.navigation.UrlChangeHandler.__handleUrlChange( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.navigation.UrlChangeHandler.handleUrlChange( ~[jmix-ui-1.2.2.jar:na]
at io.jmix.ui.navigation.UrlChangeHandler$$FastClassBySpringCGLIB$$4834d39f.invoke() ~[jmix-ui-1.2.2.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke( ~[spring-core-5.3.18.jar:5.3.18]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept( ~[spring-aop-5.3.18.jar:5.3.18]
at io.jmix.ui.navigation.UrlChangeHandler$$EnhancerBySpringCGLIB$$fcc3ebee.handleUrlChange() ~[jmix-ui-1.2.2.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke( ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( ~[na:na]
at java.base/java.lang.reflect.Method.invoke( ~[na:na]
at com.vaadin.event.ListenerMethod.receiveEvent( ~[vaadin-server-8.14.1-1-jmix.jar:8.14.1-1-jmix]
… 93 common frames omitted

Thank you guys,

Hi Emre,

DynamoDB integration is possible in Jmix. It is possible to use the custom data store as you mentioned, but I found it a little problematic since the data access model is quite different. In the custom data store, you would have to find out the intended filtering based on the JPQL query and then apply the filtering in Dynamo terms.

Instead, you can also just use a custom service together with a DTO entity. This solution seems to be quite a bit simpler.

I have prepared an example on how to do that:

Jmix - DynamoDB Integration

This example application shows how to integrate a DynamoDB table into a Jmix application.

The example scenario is the following:

For Visits, it is possible to keep a log book of VisitLog entries. Those Log entries should be stored in DynamoDB.

1. Spring Data DynamoDB dependency

There is a Spring Data DynamoDB integration out there, which we can leverage to ease the actual interaction with DynamoDB.

Add the following dependency to your Jmix application:

dependencies {
    // ...
    implementation 'com.github.derjust:spring-data-dynamodb:5.1.0'

2. DynamoDB Config

To define the DynamoDB beans that should be used, create a DynamoDBConfig class in your application like this:

@EnableDynamoDBRepositories(basePackageClasses = VisitLogRepository.class)
public class DynamoDBConfig {

	public DynamoDBMapperConfig dynamoDBMapperConfig() {
		return DynamoDBMapperConfig.DEFAULT;

	public DynamoDBMapper dynamoDBMapper(AmazonDynamoDB amazonDynamoDB, DynamoDBMapperConfig config) {
		return new DynamoDBMapper(amazonDynamoDB, config);

	public AmazonDynamoDB amazonDynamoDB() {
		return AmazonDynamoDBClientBuilder.standard()

3. VisitLog DTO entity

Now let’s create a DTO entity for the Visit log. Use the annotation from dynamodb to indicate which table should be used
and which properties are considered to be the hash key:

@DynamoDBTable(tableName = "visit-log")
@JmixEntity(name = "petclinic_VisitLog", annotatedPropertiesOnly = true)
public class VisitLog {

    private UUID id;

    @JmixProperty(mandatory = true)
    private UUID visitId;

    private String title;

    private String description;

    public UUID getVisitId() {
        return visitId;

    public void setVisitId(UUID visitId) {
        this.visitId = visitId;

    public String getTitle() {
        return title;

    public void setTitle(String title) {
        this.title = title;

    public String getDescription() {
        return description;

    public void setDescription(String description) {
        this.description = description;

    public UUID getId() {
        return id;

    public void setId(UUID id) { = id;

4. Create Spring Data Repository

Next up we can create our Spring Data repository in order to interact with the table. K


public interface VisitLogRepository extends CrudRepository<VisitLog, UUID> {

    List<VisitLog> findByVisitId(UUID visitId);

It is necessary to not let the Jmix Spring Data integration interfere with the DynamoDB Spring Data repositories.
We can achieve that by limiting the JmixDataRepositories to the subpackage: repository. The VisitLogRepository is not located
in this package. With that it will not be recognised by the Jmix Spring Data implementation.

public class JmixPetclinicApplication {

To activate the VisitLogRepository, we need to annotate our DynamoDBConfig to enable scanning and mention VisitLogRepository class:

@EnableDynamoDBRepositories(basePackageClasses = VisitLogRepository.class)
public class DynamoDBConfig {
    // ...

5. Use Repository in application Code

For easier integration additional we can create a VisitLogService, that acts as the logic layer for interacting with the Table:

public class VisitLogService {

    VisitLogRepository visitLogRepository;

    public List<VisitLog> findByVisit(Visit visit) {
        return visitLogRepository.findByVisitId(visit.getId());

    public void saveLogEntry(VisitLog visitLog) {;

6. Integrate with Jmix UI

Show Visit Log Entries



Now it is possible to use the new DTO entity in our application. It is possible to generate Screens for the DTO entity.

In this example you will find the VisitLogBrowse and VisitLogEditor accordingly.

The browse screen loads the entites via the Service during initialization of the screen:

public class VisitLogBrowse extends StandardLookup<VisitLog> {

    private Visit visit;
    private CollectionContainer<VisitLog> visitLogsDc;
    private VisitLogService visitLogService;
    private Metadata metadata;

    public void onBeforeShow(BeforeShowEvent event) {

The visit parameter is passed in by the VisitBrowse screen, where this screen is called from. The setItems method sets
the values into the data container and utilises the VisitLogService for loading the data.

Create Visit Log Entries


When creating the Visit Log Entries, we need change the way it is stored. For that we can use the commit delegate handler:

public class VisitLogEdit extends StandardEditor<VisitLog> {

    VisitLogService visitLogService;

    @Install(target = Target.DATA_CONTEXT)
    private Set<Object> commitDelegate(SaveContext saveContext) {
        return Set.of(getEditedEntity());

The actual storage is done by the VisitLogService once again.

I hope this helps to see how the integration with DynamoDB is possible.