Compare commits

..

2 Commits

Author SHA1 Message Date
Dmytro Sylaiev
6967f8da08 chore(TPS-5200): Add patch release notes 2022-04-20 20:52:28 +03:00
Dmytro Sylaiev
33a1fbcd4b fix(TDI-47802): Fix short strings as Clobs (#7425)
* Add warning for long strings as varchar
2022-04-20 20:48:56 +03:00
3 changed files with 35 additions and 23 deletions

View File

@@ -5,13 +5,13 @@ product:
- https://talend.poolparty.biz/coretaxonomy/23
---
# TPS-4124
# TPS-5200
| Info | Value |
| ---------------- | ---------------- |
| Patch Name | Patch\_20200615\_TPS-4124\_v1-7.2.1 |
| Release Date | 2020-06-15 |
| Target Version | 20190620\_1446-V7.2.1 |
| Patch Name | Patch\_20220420_TPS-5200\_v1-7.2.1 |
| Release Date | 2022-04-20 |
| Target Version | 20190620_1446-V7.2.1 |
| Product affected | Talend Studio |
## Introduction
@@ -24,7 +24,7 @@ This is a self-contained patch.
This patch contains the following fixes:
- TPS-4124 [7.2.1] ClassCastException with tLibraryLoad's Dynamics Libs in Java 11 (TDI-44305)
- TPS-5200 [7.2.1] "Parameter Type Conflict" reported when using tOracleSP component with CLOB/AUTO-MAPPING (TDI-47802)
## Prerequisites
@@ -63,4 +63,4 @@ Backup the Affected files list below. Uninstall the patch by restore the backup
The following files are installed by this patch:
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider\_7.2.1.20190614\_0309/components/tLibraryLoad/tLibraryLoad\_begin.javajet
- {Talend\_Studio\_path}/plugins/org.talend.designer.components.localprovider_7.2.1.20190614_0309/components/tOracleSP/tOracleSP_main.javajet

View File

@@ -17,19 +17,17 @@
<% if(hotLibs!=null&&hotLibs.size() > 0){%>
String[] libPaths_<%=cid %> = new String[] { <% for(Map<String, String> item : hotLibs) {%> <%=item.get("LIBPATH") %>, <%}%> };
java.net.URLClassLoader sysloader_<%=cid %> = (java.net.URLClassLoader) ClassLoader.getSystemClassLoader();
java.lang.reflect.Method method_<%=cid %> = java.net.URLClassLoader.class.getDeclaredMethod("addURL", new Class[] { java.net.URL.class });
method_<%=cid %>.setAccessible(true);
java.util.List<java.net.URL> libURL_<%=cid %> = new java.util.ArrayList<>();
for(String lib_<%=cid %>:libPaths_<%=cid %>) {
String[] libPaths_<%=cid %> = new String[] { <% for(Map<String, String> item : hotLibs){%> <%=item.get("LIBPATH") %>, <%}%> };
for(String lib_<%=cid %>:libPaths_<%=cid %> ){
String separator_<%=cid %> = System.getProperty("path.separator");
String[] jarFiles_<%=cid %> = lib_<%=cid %>.split(separator_<%=cid %>);
for(String jarFile_<%=cid %> : jarFiles_<%=cid %>) {
libURL_<%=cid %>.add( new java.io.File(jarFile_<%=cid %>).toURI().toURL() );
for(String jarFile_<%=cid %>:jarFiles_<%=cid %>){
method_<%=cid %>.invoke(sysloader_<%=cid %>, new Object[] { new java.io.File(jarFile_<%=cid %>).toURL() });
}
}
java.net.URL[] libURLArray_<%=cid %> = libURL_<%=cid %>.toArray(new java.net.URL[] {});
ClassLoader threadClassLoader_<%=cid %> = Thread.currentThread().getContextClassLoader();
java.net.URLClassLoader newthreadClassLoader_<%=cid %> = new java.net.URLClassLoader(libURLArray_<%=cid %>, threadClassLoader_<%=cid %>);
Thread.currentThread().setContextClassLoader(newthreadClassLoader_<%=cid %>);
<%}%>

View File

@@ -39,6 +39,7 @@ imports="
CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
INode node = (INode) codeGenArgument.getArgument();
String cid = node.getUniqueName();
boolean isLog4jEnabled = ("true").equals(ElementParameterParser.getValue(node.getProcess(), "__LOG4J_ACTIVATE__"));
List<Map<String, String>> spArgs =
(List<Map<String, String>>) ElementParameterParser.getObjectValue(node, "__SP_ARGS__");
@@ -188,7 +189,7 @@ if (canGenerate) {
method = "Bytes";
} else if (("Integer").equals(typeToGenerate)) {
method = "Int";
} else {
} else {
method = typeToGenerate.substring(0, 1).toUpperCase() + typeToGenerate.substring(1);
}
@@ -210,12 +211,25 @@ if (canGenerate) {
oracle.xdb.XMLType xmlType_<%=cid%> = oracle.xdb.XMLType.createXML(connection_<%=cid%>, <%=inConnectionName%>.<%=argName%>);
statement_<%=cid%>.setObject(<%=argIndex%>, xmlType_<%=cid%>);
<%
} else {
%>
statement_<%=cid%>.set<%=method%>(<%=argIndex%>, <%=inConnectionName%>.<%=argName%>);
<%
}
} else if (("String").equals(typeToGenerate) && "CLOB".equals(dbType)) {
%>
java.sql.Clob clob_<%=cid %> = connection_<%=cid %>.createClob();
clob_<%=cid %>.setString(1, <%=inConnectionName%>.<%=argName%>);
statement_<%=cid%>.setClob(<%=argIndex%>, clob_<%=cid %>);
<%
} else {
if (isLog4jEnabled && ("String").equals(typeToGenerate)) {
%>
if (<%=inConnectionName%>.<%=argName%>.length() > 4000) {
log.warn("String value is too long for VARCHAR type");
}
<%
}
%>
statement_<%=cid%>.set<%=method%>(<%=argIndex%>, <%=inConnectionName%>.<%=argName%>);
<%
}
if (nullable) {
%>
}