Mon Oct 18, 2021 7:37 am
Login Register Lost Password? Contact Us


HPCC-JDBC driver to access superfiles

Topics around the use of the JDBC driver for HPCC Systems

Wed Feb 06, 2013 10:43 am Change Time Zone

Hello,

We have successfully implemented the following things:
    A web application pushes business module-wise csv files at regular intervals which are added as sub-files to the corresponding, pre-created super-files
    The same web application queries these super-files via the HPCC-JDBC driver. When the web application/sample java code generates only a single query, the data is fetched properly from the super-file

Code: Select all
2013/02/06 01:43:15.816 - HPCC JDBC Driver registered.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@665753

HPCC Driver completed as expected - Verify results.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@665753

HPCC Driver completed as expected - Verify results.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@665753

HPCC Driver completed as expected - Verify results.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@665753

HPCC Driver completed as expected - Verify results.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@665753

HPCC Driver completed as expected - Verify results.
For loop running for : REQ1
2013/02/06 01:43:15.832 - HPCCConnection jdbc url:
2013/02/06 01:43:15.832 - Couldn't determine log level, will log at default level: INFO
2013/02/06 01:43:15.832 - HPCCDriver::connect10.101.2.170
2013/02/06 01:43:15.847 - HPCCDatabaseMetaData ServerAddress: 10.101.2.170 TargetCluster: thor eclwatch: http://10.101.2.170:8010
2013/02/06 01:43:15.847 - HPCCDatabaseMetaData Fetching HPCC INFO: http://10.101.2.170:8010/WsSMC/Activity?rawxml_
2013/02/06 01:43:16.222 - HPCC file and published query info not pre-fetched (LazyLoad enabled)
2013/02/06 01:43:16.222 - HPCCDatabaseMetaData initialized
2013/02/06 01:43:16.222 - HPCCConnection initialized - server: 10.101.2.170
2013/02/06 01:43:16.222 - HPCCConnection: createStatement(  )
2013/02/06 01:43:16.222 - HPCCStatementConstructor(conn)
Before Timestamp for REQ1 is: Wed Feb 06 13:43:16 IST 2013
2013/02/06 01:43:16.222 - HPCCStatementAttempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:43:16.222 - INCOMING SQL: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:43:16.238 - Fetching file information: http://10.101.2.170:8010/WsDfu/DFUQuery?LogicalName=TEST::SUPERFILE::CLIENTWEBCRAWLDATABASEFILE&rawxml_&filetype=Logical Files and Superfiles
2013/02/06 01:43:17.097 - Found super file: test::superfile::clientwebcrawldatabasefile
2013/02/06 01:43:17.097 - Fetching file information: http://10.101.2.170:8010/WsDfu/DFUQuery?LogicalName=test::subfile::clientwebcrawldata1_1344234710&rawxml_&filetype=Logical Files and Superfiles
2013/02/06 01:43:17.207 - Processing superfile: test::superfile::clientwebcrawldatabasefile
2013/02/06 01:43:17.207 -    Using record definition from: test::subfile::clientwebcrawldata1_1344234710
2013/02/06 01:43:17.222 - NOT USING INDEX!
2013/02/06 01:43:17.222 - HPCC URL created: http://10.101.2.170:8010/EclDirect/RunEcl?Submit&cluster=thor
2013/02/06 01:43:17.222 - HPCCStatement: execute()
2013/02/06 01:43:17.222 -    Attempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:43:17.222 - HPCCStatement: executeQuery()
2013/02/06 01:43:17.222 -    Attempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:43:17.222 - Executing ECL: &eclText=
import std;
TblDS0RecDef := RECORD varstring controller_id; varstring user_id; varstring url_link; varstring url_content; real8 url_sentiment; varstring url_date; integer8 unique_search_id; integer8 insertid; varstring statusid; varstring search_pattern; varstring word_ignored; varstring search_date; varstring detected_language; END;
TblDS0 := DATASET('~test::superfile::clientwebcrawldatabasefile', TblDS0RecDef,FLAT);
SelectStruct := RECORD
varstring user_id := TblDS0.user_id;
varstring url_date := TblDS0.url_date;
varstring url_link := TblDS0.url_link;
varstring search_date := TblDS0.search_date;
varstring url_content := TblDS0.url_content;
varstring controller_id := TblDS0.controller_id;
varstring statusid := TblDS0.statusid;
varstring search_pattern := TblDS0.search_pattern;
integer8 unique_search_id := TblDS0.unique_search_id;
varstring word_ignored := TblDS0.word_ignored;
real8 url_sentiment := TblDS0.url_sentiment;
varstring detected_language := TblDS0.detected_language;
integer8 insertid := TblDS0.insertid;
END;
DSTable := TABLE( TblDS0, SelectStruct );
OUTPUT(CHOOSEN(DSTable,ALL),NAMED('JDBCSelectQueryResult'));

2013/02/06 01:43:47.315 - Total elapsed http request/response time in milliseconds: 30093
2013/02/06 01:43:47.315 - Parsing results...
2013/02/06 01:43:47.487 - Results datsets found: 1
2013/02/06 01:43:47.487 - Finished Parsing results.
2013/02/06 01:43:47.487 - HPCCResultSet encapsulateDataSet
2013/02/06 01:43:47.519 - Results rows found: 9756
2013/02/06 01:43:47.800 - HPCCStatement: executeQuery(select tbl.* from test::superfile::clientwebcrawldatabasefile tbl )
2013/02/06 01:43:47.800 - HPCCStatementAttempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:43:47.800 - INCOMING SQL: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:43:47.800 - NOT USING INDEX!
2013/02/06 01:43:47.800 - HPCC URL created: http://10.101.2.170:8010/EclDirect/RunEcl?Submit&cluster=thor
2013/02/06 01:43:47.800 - HPCCStatement: executeQuery()
2013/02/06 01:43:47.800 -    Attempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:43:47.800 - Executing ECL: &eclText=
import std;
TblDS0RecDef := RECORD varstring controller_id; varstring user_id; varstring url_link; varstring url_content; real8 url_sentiment; varstring url_date; integer8 unique_search_id; integer8 insertid; varstring statusid; varstring search_pattern; varstring word_ignored; varstring search_date; varstring detected_language; END;
TblDS0 := DATASET('~test::superfile::clientwebcrawldatabasefile', TblDS0RecDef,FLAT);
SelectStruct := RECORD
varstring user_id := TblDS0.user_id;
varstring url_date := TblDS0.url_date;
varstring url_link := TblDS0.url_link;
varstring search_date := TblDS0.search_date;
varstring url_content := TblDS0.url_content;
varstring controller_id := TblDS0.controller_id;
varstring statusid := TblDS0.statusid;
varstring search_pattern := TblDS0.search_pattern;
integer8 unique_search_id := TblDS0.unique_search_id;
varstring word_ignored := TblDS0.word_ignored;
real8 url_sentiment := TblDS0.url_sentiment;
varstring detected_language := TblDS0.detected_language;
integer8 insertid := TblDS0.insertid;
END;
DSTable := TABLE( TblDS0, SelectStruct );
OUTPUT(CHOOSEN(DSTable,ALL),NAMED('JDBCSelectQueryResult'));

2013/02/06 01:44:18.315 - Total elapsed http request/response time in milliseconds: 30515
2013/02/06 01:44:18.315 - Parsing results...
2013/02/06 01:44:18.502 - Results datsets found: 1
2013/02/06 01:44:18.502 - Finished Parsing results.
2013/02/06 01:44:18.502 - HPCCResultSet encapsulateDataSet
2013/02/06 01:44:18.534 - Results rows found: 9756
**********result : 9756
After Timestamp is: Wed Feb 06 13:44:18 IST 2013


The real issue crops up when multiple threads try to access the same super-file via the same query

Code: Select all
2013/02/06 01:46:45.484 - HPCC JDBC Driver registered.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@3a6727

HPCC Driver completed as expected - Verify results.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@3a6727

HPCC Driver completed as expected - Verify results.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@3a6727

HPCC Driver completed as expected - Verify results.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@3a6727

HPCC Driver completed as expected - Verify results.
********************************************************************
HPCC JDBC Test Package Usage:
Connection Parameters: paramname==paramvalue
eg. ServerAddress==192.168.124.128
Prepared Statement param value: "param"==paramvalue
eg. param=='33445'

By default full test is executed.
To execute free hand sql:
freehandsql==<SQL STATEMENT>
eg. freehandsql=="select * from tablename where zip=? limit 100"

********************************************************************

*****ldriver : org.hpccsystems.jdbcdriver.HPCCDriver@3a6727

HPCC Driver completed as expected - Verify results.
For loop running for : REQ1
2013/02/06 01:46:45.500 - HPCCConnection jdbc url:
2013/02/06 01:46:45.500 - Couldn't determine log level, will log at default level: INFO
For loop running for : REQ2
2013/02/06 01:46:45.515 - HPCCConnection jdbc url:
2013/02/06 01:46:45.515 - Couldn't determine log level, will log at default level: INFO
2013/02/06 01:46:45.515 - HPCCDriver::connect10.101.2.170
2013/02/06 01:46:45.515 - HPCCDriver::connect10.101.2.170
2013/02/06 01:46:45.515 - HPCCDatabaseMetaData ServerAddress: 10.101.2.170 TargetCluster: thor eclwatch: http://10.101.2.170:8010
2013/02/06 01:46:45.515 - HPCCDatabaseMetaData ServerAddress: 10.101.2.170 TargetCluster: thor eclwatch: http://10.101.2.170:8010
2013/02/06 01:46:45.515 - HPCCDatabaseMetaData Fetching HPCC INFO: http://10.101.2.170:8010/WsSMC/Activity?rawxml_
2013/02/06 01:46:45.515 - HPCCDatabaseMetaData Fetching HPCC INFO: http://10.101.2.170:8010/WsSMC/Activity?rawxml_
2013/02/06 01:46:45.531 - Could not fetch HPCC info.
2013/02/06 01:46:45.531 - Could not fetch HPCC info.
2013/02/06 01:46:45.531 - Could not fetch cluster information.
2013/02/06 01:46:45.531 - Could not fetch cluster information.
2013/02/06 01:46:45.531 - Could not fetch cluster information.
2013/02/06 01:46:45.531 - Could not fetch cluster information.
2013/02/06 01:46:45.531 - HPCC file and published query info not pre-fetched (LazyLoad enabled)
2013/02/06 01:46:45.531 - HPCC file and published query info not pre-fetched (LazyLoad enabled)
2013/02/06 01:46:45.531 - Could not query HPCC metadata check server address, cluster name, wsecl, and wseclwatch configuration.
2013/02/06 01:46:45.531 - HPCCDatabaseMetaData initialized
2013/02/06 01:46:45.531 - Could not query HPCC metadata check server address, cluster name, wsecl, and wseclwatch configuration.
2013/02/06 01:46:45.531 - HPCCConnection initialized - server: 10.101.2.170
2013/02/06 01:46:45.531 - HPCCDatabaseMetaData initialized
2013/02/06 01:46:45.531 - HPCCConnection: createStatement(  )
2013/02/06 01:46:45.531 - HPCCConnection initialized - server: 10.101.2.170
2013/02/06 01:46:45.531 - HPCCConnection: createStatement(  )
2013/02/06 01:46:45.531 - HPCCStatementConstructor(conn)
2013/02/06 01:46:45.531 - HPCCStatementConstructor(conn)
Before Timestamp for REQ2 is: Wed Feb 06 13:46:45 IST 2013
Before Timestamp for REQ1 is: Wed Feb 06 13:46:45 IST 2013
2013/02/06 01:46:45.531 - HPCCStatementAttempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:46:45.531 - HPCCStatementAttempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:46:45.531 - INCOMING SQL: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:46:45.531 - INCOMING SQL: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
java.lang.IllegalArgumentException: timeouts can't be negative
   at sun.net.www.protocol.http.HttpURLConnection.setReadTimeout(HttpURLConnection.java:2358)
   at org.hpccsystems.jdbcdriver.HPCCDatabaseMetaData.createHPCCESPConnection(HPCCDatabaseMetaData.java:2892)
   at org.hpccsystems.jdbcdriver.HPCCDatabaseMetaData.fetchHPCCFileInfo(HPCCDatabaseMetaData.java:2202)
   at org.hpccsystems.jdbcdriver.HPCCDatabaseMetaData.tableExists(HPCCDatabaseMetaData.java:2720)
   at org.hpccsystems.jdbcdriver.ECLEngine.generateSelectECL(ECLEngine.java:129)
   at org.hpccsystems.jdbcdriver.ECLEngine.generateECL(ECLEngine.java:640)
   at org.hpccsystems.jdbcdriver.HPCCStatement.processQuery(HPCCStatement.java:72)
   at org.hpccsystems.jdbcdriver.HPCCStatement.execute(HPCCStatement.java:243)
   at org.hpccsystems.jdbcdriver.HPCCDriverTest.queryHPCC(HPCCDriverTest.java:848)
   at org.hpccsystems.jdbcdriver.HPCCQueryRunnable.run(HPCCQueryRunnable.java:28)
   at java.lang.Thread.run(Thread.java:619)
java.lang.IllegalArgumentException: timeouts can't be negative
   at sun.net.www.protocol.http.HttpURLConnection.setReadTimeout(HttpURLConnection.java:2358)
   at org.hpccsystems.jdbcdriver.HPCCDatabaseMetaData.createHPCCESPConnection(HPCCDatabaseMetaData.java:2892)
   at org.hpccsystems.jdbcdriver.HPCCDatabaseMetaData.fetchHPCCFileInfo(HPCCDatabaseMetaData.java:2202)
   at org.hpccsystems.jdbcdriver.HPCCDatabaseMetaData.tableExists(HPCCDatabaseMetaData.java:2720)
   at org.hpccsystems.jdbcdriver.ECLEngine.generateSelectECL(ECLEngine.java:129)
   at org.hpccsystems.jdbcdriver.ECLEngine.generateECL(ECLEngine.java:640)
   at org.hpccsystems.jdbcdriver.HPCCStatement.processQuery(HPCCStatement.java:72)
   at org.hpccsystems.jdbcdriver.HPCCStatement.execute(HPCCStatement.java:243)
   at org.hpccsystems.jdbcdriver.HPCCDriverTest.queryHPCC(HPCCDriverTest.java:848)
   at org.hpccsystems.jdbcdriver.HPCCQueryRunnable.run(HPCCQueryRunnable.java:28)
   at java.lang.Thread.run(Thread.java:619)
2013/02/06 01:46:45.546 - Invalid or forbidden table found: TEST::SUPERFILE::CLIENTWEBCRAWLDATABASEFILE
2013/02/06 01:46:45.546 - Invalid or forbidden table found: TEST::SUPERFILE::CLIENTWEBCRAWLDATABASEFILE
2013/02/06 01:46:45.546 - HPCCStatement: execute()
2013/02/06 01:46:45.546 - HPCCStatement: execute()
2013/02/06 01:46:45.546 -    Attempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:46:45.546 -    Attempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:46:45.546 - HPCCStatement: executeQuery()
2013/02/06 01:46:45.546 -    Attempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
2013/02/06 01:46:45.546 - HPCCStatement: executeQuery()
2013/02/06 01:46:45.546 -    Attempting to process sql query: select tbl.* from test::superfile::clientwebcrawldatabasefile tbl
java.sql.SQLException: HPCCStatement:  Cannot execute SQL command
   Invalid or forbidden table found: TEST::SUPERFILE::CLIENTWEBCRAWLDATABASEFILE
   at org.hpccsystems.jdbcdriver.HPCCStatement.executeHPCCQuery(HPCCStatement.java:110)
   at org.hpccsystems.jdbcdriver.HPCCStatement.execute(HPCCStatement.java:255)
   at org.hpccsystems.jdbcdriver.HPCCStatement.execute(HPCCStatement.java:245)
   at org.hpccsystems.jdbcdriver.HPCCDriverTest.queryHPCC(HPCCDriverTest.java:848)
   at org.hpccsystems.jdbcdriver.HPCCQueryRunnable.run(HPCCQueryRunnable.java:28)
   at java.lang.Thread.run(Thread.java:619)
java.sql.SQLException: HPCCStatement:  Cannot execute SQL command
   Invalid or forbidden table found: TEST::SUPERFILE::CLIENTWEBCRAWLDATABASEFILE
   at org.hpccsystems.jdbcdriver.HPCCStatement.executeHPCCQuery(HPCCStatement.java:110)
   at org.hpccsystems.jdbcdriver.HPCCStatement.execute(HPCCStatement.java:255)
After Timestamp is: Wed Feb 06 13:46:45 IST 2013
After Timestamp is: Wed Feb 06 13:46:45 IST 2013   at org.hpccsystems.jdbcdriver.HPCCStatement.execute(HPCCStatement.java:245)
   at org.hpccsystems.jdbcdriver.HPCCDriverTest.queryHPCC(HPCCDriverTest.java:848)
   at org.hpccsystems.jdbcdriver.HPCCQueryRunnable.run(HPCCQueryRunnable.java:28)
   at java.lang.Thread.run(Thread.java:619)


I have attached the following components:
    HPCCDriverTest.txt - actually, a java file
    HPCCQueryRunnable.java - actually, a java file
    Tester.java - actually, a java file

I did some analysis of the exception and HPCC-JDBC driver code - the primary error is at HPCCDatabaseMetaData.fetchHPCCInfo() as the first error in the log is "Could not fetch HPCC info."

In the class which I have uploaded (HPCCQueryRunnable.java), I attempted to connect http://10.101.2.170:8010/WsSMC/Activity?rawxml_ as I was suspecting that this address is not accessible. But both the threads get a response !

This is a core and crucial issue at our end - any inputs are welcome !

Thanks and regards !
Attachments
Tester.txt
the invoker class
(1.73 KiB) Downloaded 756 times
HPCCQueryRunnable.txt
the thread which accesses a super-file
(1.85 KiB) Downloaded 754 times
HPCCDriverTest.txt
slight modification to the code provided by HPCC itself
(27.68 KiB) Downloaded 746 times
kaliyugantagonist
 
Posts: 43
Joined: Mon Jul 23, 2012 11:23 am

Wed Feb 06, 2013 4:19 pm Change Time Zone

kaliyugantagonist, I wasn't able to recreate the exact issue you're seeing, but the logs you provided lead me to what I think is the problem.

But first let me mention that using a new connection object for every query is very expensive, in practice you'd prob want to share HPCCPreparedStatement objects created from a single connection.

Anyway it appears the problem stems from the shared use of a java.text.NumberFormat object. Turns out the NumberFormat object is not thread safe!

If you have github access I encourage you to report the issue there:
https://github.com/hpcc-systems/hpcc-jdbc/issues

Thanks.
rodrigo.pastrana@lexisnexis.com
 
Posts: 22
Joined: Fri Oct 07, 2011 2:24 pm

Wed Feb 06, 2013 5:05 pm Change Time Zone

Hi Rodrigo,

Thanks for your inputs.

Actually, the code cleaning/optimization is our next activity - right now, we are just trying things out.
Before posting this issue, I went through list of open and closed issues on the GitHub link and was not able to find anything similar to what I have reported. I thought I must put the issue here first and depending upon the response may/may not report it !

Can you specify in which class exactly is this non-thread safe usage of NumberFormat present so that I too can give a try to solve this issue?

Thanks and regards !
kaliyugantagonist
 
Posts: 43
Joined: Mon Jul 23, 2012 11:23 am

Wed Feb 06, 2013 5:55 pm Change Time Zone

Kaliyugantagonist,
you took the right approach, this forum is great for discussing potential issues. Actual issues are then reported and tracked on github. If you open the issue, you'll be able to track it. Otherwise I can open it, and you can add yourself as a watcher.

Anyway, HPCCJDBCUtils contains a static instance of NumberFormat format.
One quick way to resolve the threading issue is to declare the object as a ThreadLocal:

Code: Select all
public static final ThreadLocal <NumberFormat> format =
new ThreadLocal <NumberFormat>()
{
@Override
protected NumberFormat initialValue()
{
  return NumberFormat.getInstance(Locale.US);
}
};


Every reference to format then needs to call get()

Code: Select all
//format.parse(str);
format.get().parse(str);
rodrigo.pastrana@lexisnexis.com
 
Posts: 22
Joined: Fri Oct 07, 2011 2:24 pm

Fri Feb 15, 2013 10:12 pm Change Time Zone

Kaliyugantagonist,
Did you get a chance to try out the changes made for this issue?
https://github.com/hpcc-systems/hpcc-jdbc/issues/85
rodrigo.pastrana@lexisnexis.com
 
Posts: 22
Joined: Fri Oct 07, 2011 2:24 pm


Return to Java Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron