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

Retrieve (C|B)LOB on SqlRow construction #2267

Merged

Conversation

jonasPoehler
Copy link
Contributor

Hi Rob,

this PR fixes a possible problem, when selecting a LOB with RawSqlBuilder. The actual data wrapped by e.g. java.sql.Clob is not fetched until explicitely accessed and for that to work, we need an open connection. Since this is not always the case (see testcase) and it depends on the implementation of the JDBC driver to either eagerly or lazily fetch the Clob. H2 for instance seems to directly fetch the data meaning the tests would pass even without this fix, but other drivers don't behave like that.
Note: This somehow breaks the current behaviour. Currently, a call to row.get("foo") on a Clob field returns a java.sql.Clob object implemented by the JDBC driver. With the provided implementation a BLOB would return a byte-array and a CLOB a String. Since this also is a "silent" change without breaking compile-time API, this might need some special communicating or version update.

All the best
Jonas

@rbygrave
Copy link
Member

I have added a "reason-for-version-bump" tag that we can now use going forward. As we are bumping up to 12.10.0 with this next release this is a good time to merge this in I think.

@rbygrave rbygrave merged commit 103b751 into ebean-orm:master Jul 22, 2021
@jonasPoehler jonasPoehler deleted the pr/bugfix/connection_closed_on_clob branch August 16, 2021 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants