Comments (6)
I looked at the related code:
I think the errorCode and sqlState should be passed into the submitErrorTuple function. Otherwise, we could get into the situation when we are submitting the error tuple, the errorCode and sqlState are overwritten in the process method, when there are multiple streams feeding into the input port?
catch (SQLException e){
errorCode = e.getErrorCode();
sqlState = e.getSQLState();
TRACE.log(TraceLevel.DEBUG, "SQL Exception Error Code: " + errorCode);
TRACE.log(TraceLevel.DEBUG, "SQL EXCEPTION SQL State: " + sqlState);
if (hasErrorPort){
// submit error message
submitErrorTuple(errorOutputPort, tuple);
}
from streamsx.jdbc.
Here's something you can use to simulate a connection lost.
In JDBCRun.allPortsReady()
I created a thread. The thread sleeps for x number of seconds. When the timer pops, we disconnect from the db.
In JDBCConnectionHelper, I added a method to force the connection to be closed. This method simply call connection.close()... I purposefully did not change any state or do any checks to simulate something unexpected. Call this method on the thread from allPortsReady.
from streamsx.jdbc.
Just delivered a fix on this issue. Please let me know if it does not work for you.
Meanwhile, as existing design on sqlStatus and error tuple processing are not very clear, I am going to re-design this feature.
from streamsx.jdbc.
Thanks! let me try that out.
from streamsx.jdbc.
The operator will check if the JDBC connection is valid before processing the tuple. If it is not valid, the operator will reset the connection.
So there are two scenarios:
- The connection lost before tuple processing, you will not get the error tuple from error port.
- The connection lost during tuple processing, you will get the error tuple from error port.
from streamsx.jdbc.
corrected in JDBC version 1.4.0
https://github.com/IBMStreams/streamsx.jdbc/releases/tag/v1.4.0
from streamsx.jdbc.
Related Issues (20)
- streamsx.jdbc Globalization support - Update messages for translation HOT 6
- Incomplete traces: Exception text missing HOT 4
- terminate from jdbcRun HOT 3
- db2 installation folder was not specified in the script HOT 3
- Upgrade stresmsx.jdbc git pages HOT 1
- change name of the default branch HOT 1
- Documentation issues HOT 2
- Sample not cleaned with ant clean
- Prepare Makefile of sample app for Cloud Pak for Data
- Input port in JDBCRun operator should be optional HOT 1
- Provide custom operator metrics
- Support commit on window punctuation
- NPE when statement parameters do not match HOT 1
- JDBCRun cannot write SPL blobs to DB2 tables as BLOBs HOT 5
- JDBCrun did not shut down cleanly in case of SQL error HOT 2
- connection json looks for all lowercase "jdbcurl", however, all documentation and messages refer to "jdbcUrl". Which should it be. HOT 4
- Application Configuration not working HOT 4
- Propose allowing jdbcUrl to be included in the properties file that can be pointed to by the jdbcProperties parameter HOT 5
- Support additional parameters for SSL connection
- Support properties in application config for trust-/keystore passwords
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from streamsx.jdbc.