Re: Tomcat 5.0, JNDI-DataSource and Blobs

2005-06-20 Thread Martin Kalén

Ribi Roland wrote:

I found a solution:

Installed OJB 1.0.3 instead of 1.0.1


The reason it works with OJB 1.0.2 or later (and didn't in<=1.0.1) is that
Tomcat uses DBCP for Connection Pooling and that DBCP wraps the Oracle
Connection object in a DBCP-specific PoolWrapper object.

In older versions of OJB you would get exactly the same problem with
non-DataSource connection pools if you use the OJB DBCP ConnectionFactory
(configurable in OJB.properties).

We have added unwrapping of Connections object for all environments that
we have user reports for (including P6Spy, DBCP, JBoss, WebLogic).

Regards,
 Martin


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.0, JNDI-DataSource and Blobs

2005-06-16 Thread Ribi Roland
I found a solution:

Installed OJB 1.0.3 instead of 1.0.1


> -Original Message-
> From: Ribi Roland [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 16, 2005 11:11 AM
> To: 'ojb-user@db.apache.org'
> Subject: Tomcat 5.0, JNDI-DataSource and Blobs
> 
> 
> Hi
> 
> Since I moved the config of the connection pool from repository.xml to
> server.xml and get the connection via JNDI-lookup the broker 
> throws the
> following Exception:
> 
> ch.braunvieh.dbutils.DirectoryImageUploadVisitor -
> org.apache.ojb.broker.PersistenceBrokerSQLException: SQL failure while
> insert object data for 
> class ch.braunvieh.ojb.argus.TFotoMitOrig, . [Oracle thin 
> driver cannot
> update BLOB values with length>2000. (Consider using Oracle9i as OJB
> platform.)]
> 
> 
> Any hints? I did'nt change the JDBC-Driver classes or any 
> other Property...
> 
> The old config in repository.xml was:
>  jcd-alias="argus"
> default-connection="true"
> platform="Oracle9i"
> jdbc-level="3.0"
> driver="oracle.jdbc.driver.OracleDriver"
> protocol="jdbc"
> subprotocol="oracle"
>  
> dbalias="thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=T
> CP)(HOST=satur
> n.braunvieh.ch)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=AR01.s
> aturn.braunvie
> h.ch)(SERVER=DEDICATED)))" 
> initsql="ALTER SESSION USING SCHEMA GESTHO"
> username="x"
> password="x"
> ignoreAutoCommitExceptions="true"
> useAutoCommit="0">
>attribute-value="ALTER SESSION
> SET NLS_NUMERIC_CHARACTERS='.,'" />
>  maxActive="50"
>   maxIdle="20"
>   maxWait="5000"
>   whenExhaustedAction="1"
>   testOnBorrow="true"
>   testOnReturn="true"
>   testWhileIdle="false"
>   timeBetweenEvictionRunsMillis="360"
>   minEvictableIdleTimeMillis="180"
>   numTestsPerEvictionRun="20"
>   validationQuery="SELECT PA_ANI.nGetAniID('US 
> 184087.2') FROM DUAL"
>/>
>  className="org.apache.ojb.broker.util.sequence.SequenceManager
> NextValImpl"
> />
>   
> 
> And now it is:
> 
> jcd-alias="argus"
> jndi-datasource-name="java:/comp/env/jdbc/argus"
> default-connection="true"
> platform="Oracle9i"
> jdbc-level="3.0"
> ignoreAutoCommitExceptions="true"
> useAutoCommit="0"
> driver="oracle.jdbc.driver.OracleDriver">
>attribute-value="ALTER SESSION
> SET NLS_NUMERIC_CHARACTERS='.,'" />
>  className="org.apache.ojb.broker.util.sequence.SequenceManager
> NextValImpl"
> />
>   
> 
> 
> 
> The Connection-Pool is defined as follows in the server.xml:
> 
> 
>  type="javax.sql.DataSource"/> 
> 
> 
>   
> factory
> org.apache.commons.dbcp.BasicDataSourceFactory
>   
>   
> driverClassName
> oracle.jdbc.driver.OracleDriver
>   
>   
> url
>  
> jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(
> PROTOCOL=TCP)(
> HOST=saturn.braunvieh.ch)(PORT=1521)))(CONNECT_DATA=(SERVICE_N
> AME=AR01.satur
> n.braunvieh.ch)(SERVER=DEDICATED)))
>   
>   
> username
> x
>   
>   
> password
> x
>   
>   
> initialSize
> 1
>   
>   
> maxActive
> 5
>   
>   
> maxIdle
> 2
>   
>   
> minIdle
> 1
>   
>   
> maxWait
> -1
>   
>   
> validationQuery
> SELECT PA_ANI.nGetAniID('US 184087.2') FROM 
> DUAL
>   
>   
> testOnBorrow
> true
>   
>   
> testOnReturn
> true
>   
>   
> testWhileIdle
> false
>   
>   
> timeBetweenEvictionRunsMillis
> 360
>   
>   
> numTestsPerEvictionRun
> 5
>   
>   
> minEvictableIdleTimeMillis
> 180
>   
>   
> whenExhaustedAction
> 2
>   
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 5.0, JNDI-DataSource and Blobs

2005-06-16 Thread Ribi Roland
Hi

Since I moved the config of the connection pool from repository.xml to
server.xml and get the connection via JNDI-lookup the broker throws the
following Exception:

ch.braunvieh.dbutils.DirectoryImageUploadVisitor -
org.apache.ojb.broker.PersistenceBrokerSQLException: SQL failure while
insert object data for 
class ch.braunvieh.ojb.argus.TFotoMitOrig, . [Oracle thin driver cannot
update BLOB values with length>2000. (Consider using Oracle9i as OJB
platform.)]


Any hints? I did'nt change the JDBC-Driver classes or any other Property...

The old config in repository.xml was:




  

And now it is:

   


  



The Connection-Pool is defined as follows in the server.xml:


 


  
factory
org.apache.commons.dbcp.BasicDataSourceFactory
  
  
driverClassName
oracle.jdbc.driver.OracleDriver
  
  
url
 
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(
HOST=saturn.braunvieh.ch)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=AR01.satur
n.braunvieh.ch)(SERVER=DEDICATED)))
  
  
username
x
  
  
password
x
  
  
initialSize
1
  
  
maxActive
5
  
  
maxIdle
2
  
  
minIdle
1
  
  
maxWait
-1
  
  
validationQuery
SELECT PA_ANI.nGetAniID('US 184087.2') FROM DUAL
  
  
testOnBorrow
true
  
  
testOnReturn
true
  
  
testWhileIdle
false
  
  
timeBetweenEvictionRunsMillis
360
  
  
numTestsPerEvictionRun
5
  
  
minEvictableIdleTimeMillis
180
  
  
whenExhaustedAction
2
  





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]