Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以给一个替代h2做单元测试的例子吗 #249

Open
jerdbo opened this issue Nov 27, 2024 · 4 comments
Open

可以给一个替代h2做单元测试的例子吗 #249

jerdbo opened this issue Nov 27, 2024 · 4 comments

Comments

@jerdbo
Copy link

jerdbo commented Nov 27, 2024

No description provided.

@jerdbo jerdbo changed the title 可以替代👌 可以给一个替代h2做单元测试的例子吗 Nov 27, 2024
@codefollower
Copy link
Member

jdbc:h2:~/test 替换成 jdbc:lealone:embed:test

参考文档 通过嵌入模式使用Lealone数据库

@jerdbo
Copy link
Author

jerdbo commented Nov 28, 2024

这种模式下可以兼容mysql语法吗

@jerdbo
Copy link
Author

jerdbo commented Nov 28, 2024

url: jdbc:lealone:embed::pipeline_management;persistent=false;MODE=MYSQL
如果指定 mode 会报下面错误:
2024-11-28 11:04:07.247 WARN [,,,] 14922 --- [heduleService-0] c.l.db.scheduler.EmbeddedScheduler : Failed to run misc task: com.lealone.db.session.ServerSessionFactory$$Lambda$987/0x0000000800aeb028@583ac952

java.lang.NullPointerException: null
at com.lealone.db.auth.PasswordHash.validateUserPasswordHashMySQL(PasswordHash.java:102)
at com.lealone.db.auth.PasswordHash.validateUserPasswordHash(PasswordHash.java:68)
at com.lealone.db.auth.User.validateUserPasswordHash(User.java:243)
at com.lealone.db.session.ServerSessionFactory.validateUser(ServerSessionFactory.java:113)
at com.lealone.db.session.ServerSessionFactory.createServerSession(ServerSessionFactory.java:80)
at com.lealone.db.session.ServerSessionFactory.lambda$createSession$0(ServerSessionFactory.java:38)
at com.lealone.db.scheduler.SchedulerBase.runMiscTasks(SchedulerBase.java:216)
at com.lealone.db.scheduler.EmbeddedScheduler.runMiscTasks(EmbeddedScheduler.java:57)
at com.lealone.db.scheduler.EmbeddedScheduler.run(EmbeddedScheduler.java:63)
at java.lang.Thread.run(Thread.java:750)

@codefollower
Copy link
Member

lealone-mysql 插件目前不支持嵌入模式,后续再看看怎么做合适。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants