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

No data or expired data that is different from result in Dbeaver with same SQL returned #615

Open
cloorc opened this issue Nov 14, 2024 · 3 comments

Comments

@cloorc
Copy link

cloorc commented Nov 14, 2024

Oracle db:

Oracle Oracle Database 19c Enterprise Edition
Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

We are using gorm-oracle, which will import go-ora finally, to interact with Oracle database.

go-ora version in go.mod: github.com/sijms/go-ora/v2 v2.8.11.

For following SQL:

SELECT * FROM "t_key" WHERE "tenant_id" = :1 AND "app_id" = :2 AND "dispatching_key" = :3 AND "delete_flag" = :4 ORDER BY "t_key"."id"  FETCH NEXT :5 ROWS ONLY

We occasionally got nothing returned or wrong status in gorm.DB#First(). However, in Dbeaver we could see data as expected with the exactly same SQL.

We tried:

  1. Disable connection pool(set database/sql.DB#maxIdleConnection to 0), the issue can still be reproduced;
  2. Limit the connection pool to 1, the issue can still be reproduced;

We thought cursor may be leaked and we checked database/sql.Rows#Close() and make sure it will be closed finally.
We'd also doubt the session state but has very little knowledge about this.

@cloorc
Copy link
Author

cloorc commented Nov 15, 2024

Oracle db:

Oracle Oracle Database 19c Enterprise Edition
Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

We are using gorm-oracle, which will import go-ora finally, to interact with Oracle database.

go-ora version in go.mod: github.com/sijms/go-ora/v2 v2.8.11.

For following SQL:

SELECT * FROM "t_key" WHERE "tenant_id" = :1 AND "app_id" = :2 AND "dispatching_key" = :3 AND "delete_flag" = :4 ORDER BY "t_key"."id"  FETCH NEXT :5 ROWS ONLY

We occasionally got nothing returned or wrong status in gorm.DB#First(). However, in Dbeaver we could see data as expected with the exactly same SQL.

We tried:

  1. Disable connection pool(set database/sql.DB#maxIdleConnection to 0), the issue can still be reproduced;
  2. Limit the connection pool to 1, the issue can still be reproduced;

We thought cursor may be leaked and we checked database/sql.Rows#Close() and make sure it will be closed finally. We'd also doubt the session state but has very little knowledge about this.

Update: we've enabled CDC on our database(a pdb).

@cjbj
Copy link

cjbj commented Nov 15, 2024

Have you inserted but not yet committed the data in Dbeaver (or any other connection)?

@cloorc
Copy link
Author

cloorc commented Nov 15, 2024

Have you inserted but not yet committed the data in Dbeaver (or any other connection)?

I'm sure we'd never inserted, updated or deleted any data at the same time from Dbeaver.

And we disabled supplemental log for CDC and the issue is still.

Thanks a lot!

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