Spring

How spring data clean persited entities in transactional method?

房东的猫 提交于 2021-02-19 03:48:31
问题 I need to receive and save huge amount of data using spring data over hibernate. Our server allocated not enough RAM for persisting all entities at the same time. We will definitely get OutOfMemory error. So we need to save data by batches it's obvious. Also we need to use @Transactional to be sure that all data persisted or non was persisted in case of even single error. So, the question: does spring data during @Transactional method keep storing entities in RAM or entities which were

When should I use TypeExcludeFilters in Spring?

纵饮孤独 提交于 2021-02-19 03:36:30
问题 Recently, Spring Boot added TypeExcludeFilters. One prominent use case is the SpringBootApplication annotation. Before Spring Boot 1.4: // ... @ComponentScan public @interface SpringBootApplication { // ... Since Spring Boot 1.4: // ... @ComponentScan(excludeFilters = @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class)) public @interface SpringBootApplication { // ... The main motivation seems to improve testing support in Spring, but I fail to get an intuitive understanding

Spring Boot doesn't use CommonsMultipartResolver?

吃可爱长大的小学妹 提交于 2021-02-19 03:36:07
问题 I have a problem with REST web service running with Spring Boot (Jetty). One of my REST method is file upload and I'm guessing that CommonsMultipartResolver is not using during multipart requests. Signature of this upload method is : @ResponseBody @RequestMapping(value = "/upload", method = RequestMethod.POST, produces = "application/json") public BaseResponse upload(@RequestParam("login") String login, @RequestParam("passwd") String passwd, @RequestParam("partner") String partner,

Spring Boot doesn't use CommonsMultipartResolver?

纵然是瞬间 提交于 2021-02-19 03:36:06
问题 I have a problem with REST web service running with Spring Boot (Jetty). One of my REST method is file upload and I'm guessing that CommonsMultipartResolver is not using during multipart requests. Signature of this upload method is : @ResponseBody @RequestMapping(value = "/upload", method = RequestMethod.POST, produces = "application/json") public BaseResponse upload(@RequestParam("login") String login, @RequestParam("passwd") String passwd, @RequestParam("partner") String partner,

When should I use TypeExcludeFilters in Spring?

家住魔仙堡 提交于 2021-02-19 03:36:03
问题 Recently, Spring Boot added TypeExcludeFilters. One prominent use case is the SpringBootApplication annotation. Before Spring Boot 1.4: // ... @ComponentScan public @interface SpringBootApplication { // ... Since Spring Boot 1.4: // ... @ComponentScan(excludeFilters = @Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class)) public @interface SpringBootApplication { // ... The main motivation seems to improve testing support in Spring, but I fail to get an intuitive understanding

Spring config xml isn't valid after adding spring-data-jpa schema references

て烟熏妆下的殇ゞ 提交于 2021-02-19 03:34:09
问题 I have the following Exception while starting the spring context: java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/data/jpa/; lineNumber: 1; columnNumber: 55; White spaces are required between publicId and systemId. Before I added the spring-data-jpa to the spring config.xml everything worked fine.

Commit Asynchronously a message just after reading from topic

笑着哭i 提交于 2021-02-19 03:25:08
问题 I'm trying to commit a message just after reading it from the topic. I've followed this link (https://www.confluent.io/blog/apache-kafka-spring-boot-application) to create a Kafka consumer with spring. Normally it works perfect and the consumer gets the message and waits till anotherone enters in the queue. But the problem is that when I process this messages it takes a lot of time (circa 10 minutes) the kafka queue thinks that the message is not consumed (commited) and the consumers reads it

H2 database doesn't work in memory only with file

寵の児 提交于 2021-02-19 03:17:57
问题 I have a Spring MVC project set up with Hibernate and wanted to create some tests for some Services. The main application uses a PostgreSQL database and for tests I want to use H2 in memory database I created separate configuration files for the tests (both Spring and Hibernate) Everything works well until I try to hit the in memory database Hibernate configuration: @Configuration @EnableTransactionManagement @EnableJpaRepositories("<repository>") public class DataSourceTestConfig { private

H2 database doesn't work in memory only with file

↘锁芯ラ 提交于 2021-02-19 03:16:44
问题 I have a Spring MVC project set up with Hibernate and wanted to create some tests for some Services. The main application uses a PostgreSQL database and for tests I want to use H2 in memory database I created separate configuration files for the tests (both Spring and Hibernate) Everything works well until I try to hit the in memory database Hibernate configuration: @Configuration @EnableTransactionManagement @EnableJpaRepositories("<repository>") public class DataSourceTestConfig { private

H2 database doesn't work in memory only with file

我的未来我决定 提交于 2021-02-19 03:15:08
问题 I have a Spring MVC project set up with Hibernate and wanted to create some tests for some Services. The main application uses a PostgreSQL database and for tests I want to use H2 in memory database I created separate configuration files for the tests (both Spring and Hibernate) Everything works well until I try to hit the in memory database Hibernate configuration: @Configuration @EnableTransactionManagement @EnableJpaRepositories("<repository>") public class DataSourceTestConfig { private