db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Kalén <martin.ka...@curalia.se>
Subject Oracle9i platform in upcoming 1.0RC5 breaks LOB-support with oracle:thin
Date Thu, 11 Dec 2003 11:02:22 GMT
Greetings developers,
	the new PlatformOracle9iImpl has some very strange code for handling 
the flag "[GS]ET_CLOB_AND_LOB_SUPPORTED".

This flag is initialized to false and the logic to enable it is embedded 
in flow like the following:

flag = false
if (otherCondition && flag is true)
then
	check if we can set flag = true
fi


This results in regression if switching from OJB1.0RC4 platform=Oracle 
to 1.0preRC5(CVS) and platform=Oracle9i, since the code to set CLOB-data 
in prepared statements is something like:

if (datatype is <other datatypes>)
then
	process other datatypes
else if (datatype is CLOB and content is String)
then
	if (SET_CLOB_AND_LOB_SUPPORTED)
	then
		set CLOB-data in PreparedStatemend
	fi
else
	pass handling on to superclass (OracleImpl)
fi

There are two obvious issues with this approach:
1) SET_CLOB_AND_BLOB_SUPPORTED cannot ever be set to true according to 
the semantics from above
2) Even if SET_CLOB_AND_BLOB_SUPPORTED is set correctly, the break-out 
from the main if-else-flow into "if (SET_CLOB_AND_LOB_SUPPORTED)" means 
a silent NO-OP fallthrough when SET_CLOB_AND_LOB_SUPPORTED=false 
resulting in INSERT failures since the prepared statement did not get 
all it's data
"JdbcAccessImpl: SQLException during the execution of the insert
  java.sql.SQLException: ORA-01008: not all variables bound"


The patch attached to this mail modifies PlatformOracle9iImpl in two 
ways, it:
1) fixes [GS]ET_CLOB_AND_LOB_SUPPORTED semantics so that they are set 
correctly
2) joins the if-conditions for CLOB and BLOB datatypes in 
setObjectForStatement() so that fall-through for oracle:thin is 
backwards compatible with OJB1.0RC4 and does not break prepared statements

I couldn't find the issue in Scarab that PlatformOracle9iImpl originated 
from (if there was one?), so I post the patch directly to the list. Hope 
that's OK.

The Oracle9i-specific stuff is really interesting, and it would be great 
if it was working for both OCI and thin in RC5/1.0.

Regards,
  Martin

-- 
Martin Kalén
Curalia AB              Web:  http://www.curalia.se
Orrspelsvägen 2B        Mail: info@curalia.se
SE-182 79  Stocksund    Tel:  +46-8-410 064 40


Mime
View raw message