[
https://issues.jboss.org/browse/TEIID-1648?page=com.atlassian.jira.plugin...
]
Van Halbert edited comment on TEIID-1648 at 6/21/11 10:55 AM:
--------------------------------------------------------------
Note: The Teradata Database does not support more than one active request per session. If
the user attempts to do this, then the Teradata JDBC Driver blocks until the previous
request
has returned. This may negatively impact performance.
Table 12 contains JDBC Object Thread safety information.
Table 12: JDBC Object Thread Safety
JDBC Object Thread Safety
Connection Connection objects are fully thread-safe, and can be used by
multiple
threads. However, only one request is executed at a time. Subsequent
requests block until the previous request completes executing.
Statement,
PreparedStatement,
CallableStatement Statement and its subclass objects are generally not thread-safe.
One
specific case is supported. A second thread can call the cancel()
method to interrupt an executing request.
ResultSet ResultSet objects are not thread-safe. A ResultSet object should
only
be used by a single thread. A ResultSet object contains state
information that is not thread-safe, such as the wasNull state to
indicate whether the most recently called getter method returned a
NULL.
Blob, Clob Blob and Clob objects are not thread-safe. A Blob or Clob object
should only be used by a single thread. A Blob/Clob object should be
retrieved from a ResultSet by the thread that owns the ResultSet using
the ResultSet.getBlob/getClob method. After the Blob/Clob object has
been retrieved from a ResultSet, it can be used by a different thread.
Thus, multiple threads can be used to access LOB data; however, each
Blob/Clob object itself should only be used by one thread.
was (Author: van.halbert):
Note: The Teradata Database does not support more than one active request per session.
If
the user attempts to do this, then the Teradata JDBC Driver blocks until the previous
request
has returned. This may negatively impact performance.
Table 12 contains JDBC Object Thread safety information.
Table 12: JDBC Object Thread Safety
JDBC Object Thread Safety
Connection Connection objects are fully thread-safe, and can be used by
multiple
threads. However, only one request is executed at a time. Subsequent
requests block until the previous request completes executing.
Statement,
PreparedStatement,
CallableStatement Statement and its subclass objects are generally not thread-safe.
One
specific case is supported. A second thread can call the cancel()
method to interrupt an executing request.
ResultSet ResultSet objects are not thread-safe. A ResultSet object should
only
be used by a single thread. A ResultSet object contains state
information that is not thread-safe, such as the wasNull state to
indicate whether the most recently called getter method returned a
NULL.
Reading CLOB's from Teradata has issues and produces exception
when stream is read from a different thread than what the clob was read from the
resultset
---------------------------------------------------------------------------------------------------------------------------------------------------------
Key: TEIID-1648
URL:
https://issues.jboss.org/browse/TEIID-1648
Project: Teiid
Issue Type: Bug
Components: Misc. Connectors
Affects Versions: 7.4.1
Reporter: Van Halbert
Assignee: Steven Hawkins
Priority: Critical
Attachments: JDBCQueryServlet.java
The initial problem was seen when running BQT testing against the teradata source.
However, when debugging, the exception was occurring on the initial client read of the
stream. After reading teradata jdbc driver doc, it talks about how its not thread safe
and has issues when different threads are handling blobs/clobs. Which lead me to do a
simple client test. 2 tests where run run thru a servlet that obtains the teradata
connenction via jndi. Thet are as follows (attached is the sample code after the changes
used for #2):
1. simple execute/select: execute select intkey, objectvalue from bqt1.smalla, for
each row, obtain the clob and read the stream (no exception is seen)
2. execute select and read clob in a different thread: a new thread is created,
passing in the clob, thread is started and then proceeds to try to read the stream,
exceptions are seen
I'll attach the sample code.
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira