Skip to content

Commit 9f0a47c

Browse files
committed
SqlServer
1 parent a07a1b8 commit 9f0a47c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveDeferredResultSetAccess.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ private <T> CompletionStage<T> convertException(T object, Throwable throwable) {
231231
if ( cause instanceof HibernateException ) {
232232
return failedFuture( cause );
233233
}
234+
// SQL server throws an exception as soon as we run the query
235+
if ( cause instanceof UnsupportedOperationException && cause.getMessage().contains( "Unable to decode typeInfo for XML" ) ) {
236+
return failedFuture( LOG.unsupportedXmlType() );
237+
}
234238
return failedFuture( new HibernateException( cause ) );
235239
}
236240
return completedFuture( object );

hibernate-reactive-core/src/test/java/org/hibernate/reactive/types/JavaTypesArrayTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.MARIA;
4747
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.MYSQL;
4848
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.ORACLE;
49+
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.SQLSERVER;
4950
import static org.hibernate.reactive.containers.DatabaseConfiguration.dbType;
5051
import static org.hibernate.reactive.testing.ReactiveAssertions.assertThrown;
5152
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
@@ -87,7 +88,7 @@ protected Set<Class<?>> annotatedEntities() {
8788
}
8889

8990
private void testField(VertxTestContext context, Basic original, Consumer<Basic> consumer) {
90-
if ( List.of( DB2, ORACLE ).contains( dbType() ) ) {
91+
if ( List.of( DB2, SQLSERVER ).contains( dbType() ) ) {
9192
test( context, assertThrown( HibernateException.class, getSessionFactory()
9293
.withTransaction( s -> s.persist( original ) ) )
9394
.thenAccept( e -> assertThat( e.getMessage() ).startsWith( "HR000081" ) )
@@ -455,7 +456,6 @@ private static Predicate<String> arrayColumnPredicate(
455456
case MARIA:
456457
return arrayAsJsonPredicate( columnName );
457458
case SQLSERVER:
458-
return arrayAsVarbinaryPredicate( columnName, columnLength );
459459
case DB2:
460460
return arrayAsXmlPredicate( columnName );
461461
default:

0 commit comments

Comments
 (0)