h2 - Connecting with DBEaver Strange Table appears - Stack Overflow

I'm Using DBeaver 24.3.2, SpringBoot 3.4.1, Java 21.0.5, flyway 11.2.0. The persistence library ar

I'm Using DBeaver 24.3.2, SpringBoot 3.4.1, Java 21.0.5, flyway 11.2.0. The persistence library are all inherited from spring-data.

I recently switched to SpringBoot 3.4 and, doing an example project, I noticed a pretty strange behavior. I have the follow flyway and datasource config:

########## DATASOURCE CONFIG ##############
spring.datasource.url=jdbc:h2:file:D:/h2-dbms/rest-api/restapidb;AUTO_SERVER=TRUE;
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=.h2.Driver
spring.h2.console.enabled=true
spring.h2.console.settings.trace=false
spring.h2.console.settings.web-allow-others=false
spring.jpa.database-platform=.hibernate.dialect.H2Dialect

############ FLYWAY CONFIG ################
spring.flyway.user=sa
spring.flyway.password=
spring.flyway.locations=classpath:migration

My ddl is so easy that it's not even worth writing, there are just two tables in many-to-many relationships.

All works fine but, If I connect to my DB with DBeaver, the first time all seems normal, the second time I see other two table similar to mine (the difference is the prefix HTE_ and a column RN_ type integer):

As you can see the tables ROLES, USERS and USERS_ROLES are correct but I don't know what HTE_USERS and HTE_ROLES means.

Another strange thing is that the HTE tables are the same column plus one RN_ (Integer):

What a hell is that?? If I open the DB with the web console at http:/localhost:8080/h2-console (always using file mode and not in-memory) nothing of this happens.

Do you have some idea?

N.B.: I clearly don't use envers or other audit framework.

I'm Using DBeaver 24.3.2, SpringBoot 3.4.1, Java 21.0.5, flyway 11.2.0. The persistence library are all inherited from spring-data.

I recently switched to SpringBoot 3.4 and, doing an example project, I noticed a pretty strange behavior. I have the follow flyway and datasource config:

########## DATASOURCE CONFIG ##############
spring.datasource.url=jdbc:h2:file:D:/h2-dbms/rest-api/restapidb;AUTO_SERVER=TRUE;
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=.h2.Driver
spring.h2.console.enabled=true
spring.h2.console.settings.trace=false
spring.h2.console.settings.web-allow-others=false
spring.jpa.database-platform=.hibernate.dialect.H2Dialect

############ FLYWAY CONFIG ################
spring.flyway.user=sa
spring.flyway.password=
spring.flyway.locations=classpath:migration

My ddl is so easy that it's not even worth writing, there are just two tables in many-to-many relationships.

All works fine but, If I connect to my DB with DBeaver, the first time all seems normal, the second time I see other two table similar to mine (the difference is the prefix HTE_ and a column RN_ type integer):

As you can see the tables ROLES, USERS and USERS_ROLES are correct but I don't know what HTE_USERS and HTE_ROLES means.

Another strange thing is that the HTE tables are the same column plus one RN_ (Integer):

What a hell is that?? If I open the DB with the web console at http:/localhost:8080/h2-console (always using file mode and not in-memory) nothing of this happens.

Do you have some idea?

N.B.: I clearly don't use envers or other audit framework.

Share Improve this question edited Feb 3 at 8:15 CoderJammer asked Feb 2 at 23:20 CoderJammerCoderJammer 7554 gold badges11 silver badges39 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Is not an error is a normal behavior by Hibernate creating these temps table if you use sequence with allocationSize greather than 1.

As they said allocationSize with value equals to 1 causes lack of performance this is the reasons wy the default is 50.

Anyway starting from Hibernate 6.2.0 CR1 you can disable the creation of these tables with:

hibernate.hql.bulk_id_strategy.global_temporary.create_tables=false

but seems is not a good practice.

more info here.

Hope helps.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745253987a4618844.html

相关推荐

  • h2 - Connecting with DBEaver Strange Table appears - Stack Overflow

    I'm Using DBeaver 24.3.2, SpringBoot 3.4.1, Java 21.0.5, flyway 11.2.0. The persistence library ar

    2小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信