All Questions

Tagged with
Filter by
Sorted by
Tagged with
29votes
3answers
29kviews

H2 Console throwing a error webAllowOthers in H2 database

I am using heruko to deploy my application when i am trying to load my h2 console using heruko it is throwing an error saying. H2 Console Sorry, remote connections ('webAllowOthers') are disabled on ...
user avatar
  • 311
12votes
2answers
11kviews

Could any one tell me the real reason of spring-data projection in my case?

The case is: I have a repository and two methods, one of them looks like: //There is no warning about: Activity domain type or valid projection interface expected here... @Query("select distinct a....
user avatar
  • 143
10votes
1answer
18kviews

Hibernate UUID as UUID type

Trying to use a UUID as my id for PostgreSQL and H2, the current exceptions are for H2 java.lang.IllegalArgumentException: Can not set java.util.UUID field com.lm.model.Task.id to java.lang.String at ...
user avatar
9votes
2answers
15kviews

How to access in memory h2 database of one spring boot application from another spring boot application

In my project, i have created 3 spring boot application. First spring boot application has h2 embedded database. Now i want to access this database from my 2nd and 3rd spring boot application directly ...
user avatar
  • 107
7votes
2answers
11kviews

Spring Boot: H2 database not saved to file

I'm trying to persist an H2 in-memory DB to a file with Spring Boot to reuse the data in there. Unfortunately, the way to specify the datasource url like spring.datasource.url = jdbc:h2:file:~/...
user avatar
  • 610
7votes
2answers
16kviews

How do you connect to H2 as a remote database instead of embedded mode using Spring Boot?

I have this configuration under src/main/resources for my little Spring Boot application: server.port = 8090 spring.datasource.driverClassName = org.h2.Driver spring.datasource.url = jdbc:h2:file:~/...
user avatar
  • 371
7votes
1answer
1kviews

Failover @Type for h2?

I have to do the @Type for PostgreSQL, to get it's native UUID type, but this caused query problems with H2 @Id @Override @Type(type = "pg-uuid") @GeneratedValue(generator = "uuid2") @...
user avatar
6votes
3answers
4kviews

Spring Data JPA aggregate functions on an empty resultset

I am working on a project involving Spring and JPA/Hibernate. The database driver used in my development environment is H2. My application has a page that displays statistics, one example of such a ...
user avatar
5votes
1answer
19kviews

org.hibernate.PersistentObjectException: detached entity passed to persist with H2 in memory database

i am using H2 in memory database for testing and my configuration is as follows: 1- SpringTestingConfig: @Configuration @ComponentScan(basePackages = "com.myapp.data", excludeFilters = { @Filter(...
user avatar
5votes
3answers
534views

SpringBoot: Configuring Spring DataSource for Tests

I have a SpringBoot app. I have created this test: @ContextConfiguration(classes={TestConfig.class}) @RunWith(SpringRunner.class) @SpringBootTest public class SuncionServiceITTest { @Test ...
user avatar
  • 1,423
5votes
1answer
5kviews

Spring boot H2 db mode oracle

Hi I have a spring boot app (2.3.1.RELEASE, ojdbc8) and basically it is connected to an oracle database. The spring boot app starts find when it is connected to the oracle db.However fails to start ...
user avatar
5votes
1answer
1kviews

Not able to import sql insert script data from data.sql in a Spring Boot application

I have a very basic Spring Boot application that has schema.sql and data.sql which creates an H2 DB schema and imports data respectively. My schema is getting generated fine in the H2 DB but for some ...
user avatar
  • 5,202
5votes
0answers
936views

SpringFramework: @Transactional(readOnly = true) not working with h2

I am doing transaction testing with the SpringFramework. I have the following classes. UserService.class @Transactional public interface UserService { void add(User user); @Transactional(...
user avatar
  • 51
3votes
1answer
2kviews

Spring Boot 2 + Flyway + H2: can't see generated migration in H2 Console

I have h2 and flyway enabled in my Spring Boot 2 project. I have properties as follows: spring.datasource.url: jdbc:h2:mem:mydatabasename spring.datasource.driverClassName: org.h2.Driver spring....
user avatar
  • 7,338
3votes
1answer
2kviews

H2 Spring-Data - default value doesn't work

I'm trying to have a default value for one attribute, when I persist an object in H2 database with no value for this attribute. Even with the right entity declaration, the default value is not ...
user avatar

15 30 50 per page
1
2 3 4 5