db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armin Waibel <arm...@apache.org>
Subject Re: BlobTest and Torque
Date Thu, 24 Feb 2005 12:24:29 GMT
Hi Martin,

 > Armin, can you try to apply OJB269 (that is change
 > src/schema/ojbtest-schema.xml /database/table[@name='BLOB_TEST'] column
 > BLOB_VALUE_ to "BLOB" and CLOB_VALUE_ to "CLOB") and run BlobTest with
 > updated profiles for sapDB/maxDB (both previously indicated as failing
 > by you if applying OJB269).
 >
 > If it's still failing someone might perhaps look into tweaking OJB's
 > platform implementation for supporting the new DDL on sapDB/maxDB? (See
 > type mappings below, I don't know sapDB well enough to tell if there's
 > any significant differences.)

I made the changes you mentioned. The problem now is a wrong mapping for 
sapdb in torque-3.0.2.jar/sql/base/sapdb/dp.props file. As sapdb does 
not support BLOB/CLOB the mapping is
...
BLOB = LONG BYTE
CLOB = LONG UNICODE

<failure>
insert-sql:
[torque-sql-exec] Our new url -> jdbc:sapdb://localhost/OJB
[torque-sql-exec] Executing file: 
E:\dev\OJB_10~1.X\db-ojb\target\test\sql\ojbtest-schema.sql
[torque-sql-exec] Failed to execute: CREATE TABLE BLOB_TEST ( ID INTEGER 
NOT NULL, BLOB_VALUE_ LONG BYTE, CLOB_VALUE_ LONG UNICODE )
</failure>

to make the creation of the DB table possible it needs
...
BLOB = LONG BYTE
CLOB = LONG VARCHAR
because LONG UNICODE is not supported in sapdb.

If I patch the torque jar the blob test run without problems.

So I suggest to patch the torque jar file (and add a note in the 
release-notes) to enable best support for all used databases.
What do you think?

regards,
Armin

Martin Kalén wrote:
> I must have been suffering from amnesia earlier tonight since I was 
> confused over an issue I have already resolved before. :)
> 
> The CLOB/BLOB issue is here:
> http://issues.apache.org/scarab/issues/id/OJB269
> 
> See also Armin's answer why this was not applied in CVS and my comment 
> to this:
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=ojb-dev@db.apache.org&msgNo=7962

> 
> 
> I'm no longer sure my comment applies but I still think it does make 
> sence to run a _Blob_Test using BLOB. :)
> 
> 
> As it turns out Oracle is the platform with correct Torque mapping:
> BLOB = BLOB
> CLOB = CLOB
> 
> To see how Torque will map, check out 
> lib/torque-3.0.2.jar!/sql/base/{$torque.database}/db.props
> 
> I think the bug is actually in OJB's profile-files that come from an old 
> version of Torque. In the profile it should be property 
> *torque.database* set under "TARGET DATABASE", not database only as in 
> most OJB profiles in CVS.
> 
> Armin, can you try to apply OJB269 (that is change 
> src/schema/ojbtest-schema.xml /database/table[@name='BLOB_TEST'] column 
> BLOB_VALUE_ to "BLOB" and CLOB_VALUE_ to "CLOB") and run BlobTest with 
> updated profiles for sapDB/maxDB (both previously indicated as failing 
> by you if applying OJB269).
> 
> If it's still failing someone might perhaps look into tweaking OJB's 
> platform implementation for supporting the new DDL on sapDB/maxDB? (See 
> type mappings below, I don't know sapDB well enough to tell if there's 
> any significant differences.)
> 
> Hopefully we can find a permutation of {profile database, schema-xml 
> datatypes, platform implementation/JDBC type mappings} that works for 
> all databases -- knock on wood.
> 
> Some Torque mappings 3.0.2 for comparison:
> oracle
> ------
> LONGVARCHAR = VARCHAR2 (2000)
> LONGVARBINARY = LONG RAW
> BLOB = BLOB
> CLOB = CLOB
> 
> sapdb
> -----
> LONGVARCHAR = LONG VARCHAR
> LONGVARBINARY = LONG BYTE
> BLOB = LONG BYTE
> CLOB = LONG UNICODE
> 
> Good night,
>  Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message