ISC_VERSION :
"v11.0p_2016-09-07" / "v11.0p_2016-11-11"
OS and Browser: Google Chrome Version 54.0.2840.99 m (64-bit)
DATABASE VERSION:
Oracle 11g
I've tried to search into documentation if it was possible (or not) work with multiple binary fields in a single datasource, but i didn't found anything.
So i tried and i failed. I've encountered two problems in both add and update operation.
Problem 1: Upload binary fields error in add operation
When i try to add a record, using the form, with 3 uploded File, only the first binary field (HOME_JERSEY) is saved correctly, the others not.
Seeing the log, i noticed that in the create statement SmartClient try to save the others 2 file without related fields (_FILENAME, _FILESIZE, _DATE_CREATED)
INSERT LOG:
Step to reproduce:
1. Fill the "Nome" field (Ex. "Team_1")
2. Choose a File for the "Home Jersey" field
3. Choose a File for the "Away Jersey" field
4. Choose a File for the "Third Jersey" field
5. Click on "save" button.
Problem 2: Upload binary fields error in update operation
When i try to upload in an update operation a field that is differet from "AWAY_JERSEY", the update fails with a SQLException: Invalid column index.
Step to reproduce:
1. Select a record from the grid
2. Choose a File for the "Home Jersey" field
3. Click on "save" button.
Update log:
Code to reproduce:
TABLE and SEQUENCE:
DATASOURCE:
JS:
so, you cannot have multiple binary fields in a single datasource? or are they bug?
Thanks.
"v11.0p_2016-09-07" / "v11.0p_2016-11-11"
OS and Browser: Google Chrome Version 54.0.2840.99 m (64-bit)
DATABASE VERSION:
Oracle 11g
I've tried to search into documentation if it was possible (or not) work with multiple binary fields in a single datasource, but i didn't found anything.
So i tried and i failed. I've encountered two problems in both add and update operation.
Problem 1: Upload binary fields error in add operation
When i try to add a record, using the form, with 3 uploded File, only the first binary field (HOME_JERSEY) is saved correctly, the others not.
Seeing the log, i noticed that in the create statement SmartClient try to save the others 2 file without related fields (_FILENAME, _FILESIZE, _DATE_CREATED)
INSERT LOG:
Code:
INSERT INTO TEAMS ( AWAY_JERSEY, AWAY_JERSEY_DATE_CREATED, HOME_JERSEY, HOME_JERSEY_DATE_CREATED, HOME_JERSEY_FILENAME, HOME_JERSEY_FILESIZE, NOME, THIRD_JERSEY, THIRD_JERSEY_DATE_CREATED, ID_REC ) VALUES ( ?, TO_DATE('2016-11-24 12:12:11','YYYY-MM-DD HH24:MI:SS'), ?, TO_DATE('2016-11-24 12:12:11','YYYY-MM-DD HH24:MI:SS'), 'arrow.png', 590, 'Team_1', ?, TO_DATE('2016-11-24 12:12:11','YYYY-MM-DD HH24:MI:SS'), SQ_ID_REC.NextVal )
1. Fill the "Nome" field (Ex. "Team_1")
2. Choose a File for the "Home Jersey" field
3. Choose a File for the "Away Jersey" field
4. Choose a File for the "Third Jersey" field
5. Click on "save" button.
Problem 2: Upload binary fields error in update operation
When i try to upload in an update operation a field that is differet from "AWAY_JERSEY", the update fails with a SQLException: Invalid column index.
Step to reproduce:
1. Select a record from the grid
2. Choose a File for the "Home Jersey" field
3. Click on "save" button.
Update log:
Code:
2016-11-24 12:21:55,521 INFO SQLDriver [builtinApplication.TEAMS_update] Executing SQL query on 'test' using connection '892375283': UPDATE TEAMS SET HOME_JERSEY =?, HOME_JERSEY_FILENAME ='arrow.png', HOME_JERSEY_FILESIZE =590, NOME ='Team_1' WHERE (TEAMS.ID_REC=6) Nov 24, 2016 12:21:55 PM oracle.jdbc.driver.OraclePreparedStatement setStringInternal SEVERE: 2B12068 Throwing SQLException: 3 2016-11-24 12:21:55,533 DEBUG SQLDriver [builtinApplication.TEAMS_update] FAILED to execute SQL update in 'test' using connection'892375283' 2016-11-24 12:21:55,533 DEBUG DSRequest freeOnExecute is false for request of type update on DataSource TEAMS - not freeing resources! 2016-11-24 12:21:55,533 WARN RequestContext dsRequest.execute() failed: java.sql.SQLException: Invalid column index java.sql.SQLException: Invalid column index at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:7829) at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:7783) at oracle.jdbc.driver.OraclePreparedStatementWrapper.setString(OraclePreparedStatementWrapper.java:914) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135) at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135) at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:934) at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:840) at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:1027) at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:598) at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:2116) at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:449) at com.isomorphic.sql.SQLDataSource.executeUpdate(SQLDataSource.java:398) at com.isomorphic.datasource.DataSource.execute(DataSource.java:2281) at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:735) at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:652) at com.isomorphic.application.AppBase.execute(AppBase.java:493) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2723) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:230) at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:187) at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152) at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:200) at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.test.utils.Log4jSessionFilter.doFilter(Log4jSessionFilter.java:65) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:109) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260) at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at com.isomorphic.js.JSSyntaxScannerFilter._doFilter(JSSyntaxScannerFilter.java:262) at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1721) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1679) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)
Code to reproduce:
TABLE and SEQUENCE:
Code:
CREATE TABLE TEAMS ( "ID_REC" NUMBER(10,0), "NOME" VARCHAR2(100 BYTE) NOT NULL ENABLE, "HOME_JERSEY" BLOB, "HOME_JERSEY_FILENAME" VARCHAR2(255 BYTE), "HOME_JERSEY_FILESIZE" NUMBER(10,0), "AWAY_JERSEY" BLOB, "AWAY_JERSEY_FILENAME" VARCHAR2(255 BYTE), "AWAY_JERSEY_FILESIZE" NUMBER(10,0), "THIRD_JERSEY" BLOB, "THIRD_JERSEY_FILENAME" VARCHAR2(255 BYTE), "THIRD_JERSEY_FILESIZE" NUMBER(10,0), "HOME_JERSEY_DATE_CREATED" DATE, "AWAY_JERSEY_DATE_CREATED" DATE, "THIRD_JERSEY_DATE_CREATED" DATE, CONSTRAINT "PK_OSS_SQUADRE" PRIMARY KEY ("ID_REC") ) CREATE SEQUENCE SQ_ID_REC MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 2000 NOORDER NOCYCLE ;
Code:
<DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema" ID="TEAMS" tableName="TEAMS" dbName="test" dataSourceVersion="1" serverType="sql" dropExtraFields="false" > <fmt:bundle basename="i18nMessages" encoding="utf-8"/> <fields> <field name="ID_REC" type="sequence" sequenceName="SQ_ID_REC" primaryKey="true"/> <field name="NOME" type="text"/> <field name="HOME_JERSEY" type="binary"/> <field name="HOME_JERSEY_FILENAME" type="text"/> <field name="HOME_JERSEY_FILESIZE" type="integer"/> <field name="HOME_JERSEY_DATE_CREATED" type="creatorTimestamp"/> <field name="AWAY_JERSEY" type="binary"/> <field name="AWAY_JERSEY_FILENAME" type="text"/> <field name="AWAY_JERSEY_FILESIZE" type="integer"/> <field name="AWAY_JERSEY_DATE_CREATED" type="creatorTimestamp"/> <field name="THIRD_JERSEY" type="binary"/> <field name="THIRD_JERSEY_FILENAME" type="text"/> <field name="THIRD_JERSEY_FILESIZE" type="integer"/> <field name="THIRD_JERSEY_DATE_CREATED" type="creatorTimestamp"/> </fields> </DataSource>
JS:
Code:
isc.Window.create({ ID:"windowTest", height:500, width:1000, items:[ isc.ListGrid.create({ ID:"gridTest", dataSource:"TEAMS", width:"100%", height:"50%", autoFetchData:true, recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue){ formTest.editRecord({ID_REC:record.ID_REC, NOME:record.NOME}); }, fields:[ { name:"ID_REC", type:"int" }, { name:"NOME", type:"text" }, { name:"HOME_JERSEY", type:"binary" }, { name:"AWAY_JERSEY", type:"binary" }, { name:"THIRD_JERSEY", type:"binary" } ] }), isc.DynamicForm.create({ ID:"formTest", width:"100%", heigth:"50%", dataSource:"TEAMS", colNums:4, fields:[ { name:"NOME", type:"text" }, { name:"HOME_JERSEY", type:"binary", editorType:"FileItem" }, { name:"AWAY_JERSEY", type:"binary", editorType:"FileItem" }, { name:"THIRD_JERSEY", type:"binary", editorType:"FileItem" }, { name:"savebutton", type:"button", title:"Save", click: function(){ formTest.saveData (function(dsResponse,data){ if(dsResponse.status == 0){ formTest.editNewRecord(); gridTest.invalidateCache(); } }); } } ] }) ] })
so, you cannot have multiple binary fields in a single datasource? or are they bug?
Thanks.
Comment