[
https://issues.apache.org/jira/browse/NIFI-8524?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pierre Villard resolved NIFI-8524.
----------------------------------
Resolution: Feedback Received
Apache NiFi 1.x is no longer maintained and no new release is planned on the
1.x release line. Marking as resolved as part of a cleanup operation. Please
open a new one with an updated description if this is still relevant for NiFi
2.x.
> PutDatabaseRecord fails when inserting or updating a CHAR column
> ----------------------------------------------------------------
>
> Key: NIFI-8524
> URL: https://issues.apache.org/jira/browse/NIFI-8524
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 1.13.2
> Environment: RHEL 7.4 using OpenJDK 11 with mssql-jdbc-9.2.1.jre11.jar
> Reporter: Roger Sliva
> Priority: Major
>
> PutDatabaseRecord fails when inserting or updating into a SQL Server 12+
> table with a CHAR(1) column.
> com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN
> to CHAR is unsupported.
> This works in 1.11.4
> When the CHAR columns are converted to VARCHAR the fail does not occur.
>
> From nifi-app.log:
> 2021-05-05 09:43:13,938 ERROR [Timer-Driven Process Thread-10]
> o.a.n.p.standard.PutDatabaseRecord
> PutDatabaseRecord[id=88544076-0170-1000-abaf-0ff508f882b1] Failed to put
> Records to database for
> StandardFlowFileRecord[uuid=07ecd86b-9568-4f3f-a7e9-03b59a1069be,claim=StandardContentClaim
> [resourceClaim=StandardResourceClaim[id=1620232684227-3, container=default,
> section=3], offset=272241,
> length=539],offset=0,name=6eee14cb-6c23-497e-b01a-84875d76c810,size=539].
> Routing to failure.: com.microsoft.sqlserver.jdbc.SQLServerException: The
> conversion from UNKNOWN to CHAR is unsupported.
> com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN
> to CHAR is unsupported.
> at
> com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:234)
> at
> com.microsoft.sqlserver.jdbc.DataTypes.throwConversionError(DataTypes.java:1112)
> at
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(SQLServerPreparedStatement.java:1588)
> at
> com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(SQLServerPreparedStatement.java:1507)
> at
> org.apache.commons.dbcp2.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:529)
> at
> org.apache.commons.dbcp2.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:529)
> at jdk.internal.reflect.GeneratedMethodAccessor375.invoke(Unknown Source)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:566)
> at
> org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:254)
> at
> org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.access$100(StandardControllerServiceInvocationHandler.java:38)
> at
> org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler$ProxiedReturnObjectInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:240)
> at com.sun.proxy.$Proxy150.setObject(Unknown Source)
> at
> org.apache.nifi.processors.standard.PutDatabaseRecord.executeDML(PutDatabaseRecord.java:736)
> at
> org.apache.nifi.processors.standard.PutDatabaseRecord.putToDatabase(PutDatabaseRecord.java:841)
> at
> org.apache.nifi.processors.standard.PutDatabaseRecord.onTrigger(PutDatabaseRecord.java:487)
> at
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
> at
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1173)
> at
> org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:214)
> at
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
> at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
> at
> java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
> at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
> at
> java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at
> java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:834)
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)