Spring boot application with spring data cassandra failing to start

I have a spring boot application with spring web & spring data cassandra as dependencies. And I have a main method in a class annotated with @SpringBootApplication. &…

Null repository even with @Autowired implemented

I have the following controller. The following line works just fine: user = userRepository.selectUserByLogin(name); It correctly returns the user. @Controller public class TestController { @…

Records appear to be locked between sequential database operations (Spring Data, Hibernate)

I’m experiencing what seems to be a record lock between sequential (not concurrent) database operations, which I can’t explain. Situation Method saveRegistrationToken is called from a REST controller. …

Mongo aggregate sum of two Strings

I am trying to sum one field in Mongo. If it is an Integer there is no issue, but the problem is that it is String and I get 0 for totalAmount private Integer findRequestAmount(String agentId, String …

How to load the collection of a LAZY association for an already found entity

Consider the following: @Entity @Table(name = “cars”) public class Car { @Id private int id; private String name; @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType….

How to get the value from system property in spring boot

I am using following command to run my spring boot application java -Dlibrary.system.property=value -jar myapp.jar Currently, I am able to access it via following command like below System….

How to make Spring server to start even if database is down?

I’m using a Spring Boot(1.4.7) & MyBatis. spring.main1.datasource.url=jdbc:mariadb://192.168.0.11:3306/testdb?useUnicode=true&characterEncoding=utf8&autoReconnect=true&socketTimeout=…

`Type cannot be null` exception when trying to run out Stored Procedure using Spring Data JPA

I am trying to invoke a Stored Procedure whose signature looks like the following: CREATE OR REPLACE PROCEDURE FIND_FIRST_BOOKMARK_GT(bookmark IN NUMBER, cur OUT SYS_REFCURSOR) I am using Spring-…

How to inject multiple JPA EntityManager (persistence units) when using Spring

I need to use one database for queries (non-modifying) and one for commands (modifying). I am using Spring Data JPA, so I have two configuration classes: @Configuration @EnableJpaRepositories(value = …

Spring dynamically choosing between data sources (alternative to ThreadLocal)

I’ve read about AbstractRoutingDataSource and the standard ways to bind a datasource dynamically in this article: public class CustomerRoutingDataSource extends AbstractRoutingDataSource { @…