Skip to content

DeferredQueryInvocationHandler fails to unwrap QuerySqmImpl class outside of transaction #32766

Closed
@beikov

Description

@beikov

Affects: All versions

DeferredQueryInvocationHandler should return method.invoke(this.target, args); in an else branch for the unwrap method, otherwise the returned object might not be of the requested type. Consider e.g.

QuerySqmImpl<?> hqlQuery = query.unwrap(QuerySqmImpl.class);

This will fail with a class cast exception when using a proxy with DeferredQueryInvocationHandler.

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions