cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select
Date Mon, 23 Aug 2010 06:46:17 GMT

    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12901284#action_12901284
] 

Andrus Adamchik commented on CAY-1470:
--------------------------------------

> fixedString String (containing boolean value) "true" causes JDBC to use FIXED CHAR semantics
when setObject() is called with a String argument. 
> ...
> So it solves this problem in best way.

Awesome. That's the ideal way to fix such things.

> Now I'm wandering it we could build-in setting of this property somewhere in Cayenne?


Actually no. We intentionally never attempt to reconfigure DataSource from within Cayenne,
as DataSource is an external subsystem to Cayenne, that should be independently configurable
in a JEE environment. If this can possibly be done per PreparedStatement, then we can probably
try it (although not sure how that would affect internal driver caching of PreparedStatements).
Doing it globally per DataSource (or even per Connection), is going to affect other users
of that DataSource/Connection.

> Oracle: Problem with bind CHAR in select
> ----------------------------------------
>
>                 Key: CAY-1470
>                 URL: https://issues.apache.org/jira/browse/CAY-1470
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 2.0 branch, 3.0
>            Reporter: Evgeny Ryabitskiy
>            Assignee: Evgeny Ryabitskiy
>            Priority: Critical
>             Fix For: 2.0.5, 3.1M1
>
>         Attachments: CAY-1470.patch, CAY-1470.patch, CAY-1470.patch
>
>
> I have Table tUser
> desc tUser
> Name                           Null                Type                             
                                                                                         
                                                                  
> ------------------------------ -------- 
> USERID                         NOT NULL NUMBER(15)                                  
                                                                                         
                                                       
> BRIEF                             NOT NULL CHAR(30)   
> And wish to find user with BRIEF 'credit' :
> INFO  QueryLogger: Detected and installed adapter: org.apache.cayenne.dba.oracle.OracleAdapter
> INFO  QueryLogger: SELECT * FROM tUser WHERE Brief = ? [bind: 'credit']
> INFO  QueryLogger: === returned 0 rows. - took 125 ms.
> But if I try whitespaces at the end I would get:
> INFO  QueryLogger: SELECT * FROM tUser WHERE Brief = ? [bind: 'credit               
        ']
> INFO  QueryLogger: === returned 1 row. - took 109 ms.
> It's absolutely not CROSS DB behavior!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message