code: private TransactionalDataSource getTransactionalDataSource(
              ODataRequestContext odataRequestContext, Type type) throws ODataException {
          DataSource dataSource = dataSourceFactory.getDataSource(odataRequestContext, type.getFullyQualifiedName());
          String dataSourceKey = dataSource.getClass().toString();
          if (dataSourceMap.containsKey(dataSourceKey)) {
              return dataSourceMap.get(dataSourceKey);
          } else {
              TransactionalDataSource transactionalDataSource = dataSource.startTransaction();
  
              dataSourceMap.put(dataSourceKey, transactionalDataSource);
              return transactionalDataSource;
          }
      }
docs: If it's the first batch request call - start transaction.
  @param type The type of the entity to request a datasource for