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

Bad connection issue when mem=false and when calling the conn.Ping() #5

Open
johnson-ajar opened this issue Apr 5, 2024 · 2 comments

Comments

@johnson-ajar
Copy link

johnson-ajar commented Apr 5, 2024

Hi,

I tried connecting to the h2 database after running
java -cp h2*.jar org.h2.tools.Server -tcp -tcpAllowOthers -ifNotExists -trace -trace -baseDir ./tempData

When I try to open a connection its successful
conn, err := sql.Open("h2", "h2://sa@localhost:9092/testdb1?mem=false&logging=info")

When I try conn.Ping() get the following error.

@line 50 in conn.go get the error SQL Error: Unknown which is then returned as
driver: bad connection

Commented the Ping() call and execute the following sql query.
ret, err := conn.Exec("CREATE TABLE test (id int not null, name varchar(100));")
get the following error.
Can't execute sentence: SQL Error: unknown: Can't read all data needed.

I would like to connect to h2 database, where the database is created in a data folder, instead of memory.
I checked out all the examples and they all seems to work only for in memory database.

Please can you suggest me how to fix this issue.

thanks
Johnson

@vhlebnikov
Copy link

@johnson-ajar did you solve the issue?

@giamma
Copy link

giamma commented Sep 18, 2024

Same issue for me, driver does not work with mem=false

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

3 participants