You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org> on 2010/08/04 16:06:16 UTC

[jira] Created: (CAY-1470) Oracle: Problem with bind CHAR in select

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: 3.0, 2.0 branch
            Reporter: Evgeny Ryabitskiy
            Assignee: Evgeny Ryabitskiy
            Priority: Critical
             Fix For: 2.0.5, 3.0.1, 3.1M1


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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895703#action_12895703 ] 

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

So what happens if this is used with a VARCHAR column? Will there be any disadvantage over "setString"?

> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895570#action_12895570 ] 

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

Nice. 

+        if (value == null || SET_FIXED_CHAR_METHOD == null || type == Types.CLOB) {
+            // TODO should we check (st instance of OraclePreparedStatement) here?
+            super.setJdbcObject(st, value, pos, type, scale);
+        }

Yeah, one possible issue is when PreparedStatement is decorated (e.g. by DBCP connection pool), and the decorator interface is simple PreparedStatement with no Oracle methods.

> 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
>
>
> 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.


[jira] Updated: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1470:
-----------------------------------

    Attachment: CAY-1470.patch

sorry.. redeploy patch

> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895668#action_12895668 ] 

Evgeny Ryabitskiy commented on CAY-1470:
----------------------------------------

PreparedStatement is decorated by OraclePreparedStatementWrapper By Oracle driver... If I am using ConnectionPool

> 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
>
>
> 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.


[jira] Updated: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1470:
-----------------------------------

    Fix Version/s:     (was: 3.0.1)

> 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
>
>
> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895755#action_12895755 ] 

Evgeny Ryabitskiy commented on CAY-1470:
----------------------------------------

It's very good question. I will examine it.
Behavior tests + performance tests

While I ma studding this problem... could you say.. if it's possible to use Oracle Driver class in Cayenne?

We could set scope "provided" for this dependency
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
so it will be not transitive.

One little problem is with not Oracle JDBC driver for Oracle... not sure if it's exists....?

This question is because using native Java code is faster then Reflection....


> 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.


[jira] Updated: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1470:
-----------------------------------

    Attachment:     (was: CAY-1470.patch)

> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895324#action_12895324 ] 

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

> Will be small patch for revision soon (today-tomorrow). 

That'll be cool as long as there is a failover to the current operation mode if reflection fails (e.g. if Oracle decides to change their API, or if there are driver versions that don't have it).

> 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
>
>
> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895296#action_12895296 ] 

Evgeny Ryabitskiy commented on CAY-1470:
----------------------------------------

related topic about this problem:

http://forums.oracle.com/forums/thread.jspa?threadID=183252

there is some solution for this problem via JDBC

> 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
>
>
> 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.


[jira] Updated: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1470:
-----------------------------------

    Attachment: CAY-1470-Test.patch

I have add fix for this problem + some test case.

But test will fail on Oracle since fixedString property not set.

In CAY-1470-Test.patch some change to DriverDataSource which will help to fix tests, if you don't mind I will commit it.

> 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-Test.patch, 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12901202#action_12901202 ] 

Evgeny Ryabitskiy commented on CAY-1470:
----------------------------------------

To be honest I don't like solution with some inner methods.
It's not working with DBCP since PreparedStatements are wrapped.

Good news.
I have found better solution.

In  Connection Properties for Oracle JDBC Drivers
http://download.oracle.com/docs/cd/B14117_01/java.101/b10979/basic.htm#g1028323

fixedString 	String (containing boolean value) 
"true" causes JDBC to use FIXED CHAR semantics when setObject() is called with a String argument. By default JDBC uses VARCHAR semantics. The difference is in blank padding. By default there is no blank padding. For example, 'a' does not equal 'a ' in a CHAR(4) unless fixedString is "true".

So it solves this problem in best way.

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


> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12910533#action_12910533 ] 

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

> In CAY-1470-Test.patch some change to DriverDataSource which will help to fix tests, if you don't mind I will commit it.

This is pretty heavy-handed... Now of course Oracle won't let you pass properties as JDBC URL parameters (and this is supposed to be the most robust DB out there!)... I suggest maybe adding support for JDBC properties to be read per-profile from ~/.cayenne/connection.properties , as this is the file where we configure specific DBs without affecting others. E.g.:

oracle.jdbc.driver = oracle.jdbc.driver.OracleDriver
oracle.jdbc.driver.fixedString = true

> 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-Test.patch, 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.


[jira] Updated: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1470:
-----------------------------------

    Attachment: CAY-1470.patch

One more patch... tested... it works anyway
on Cayenne ConnectionPool / DBCP... Finally got what I want...

Unfortunately solution become more complicated....
Hope there are no more PreparedStatements then
OraclePreparedStatement 
OraclePreparedStatementWrapper

in Oracle Driver


> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895315#action_12895315 ] 

Evgeny Ryabitskiy commented on CAY-1470:
----------------------------------------

Yes, RTRIM kills indexes as well.

I would suggest to overwrite org.apache.cayenne.access.types.CharType.setJdbcObject(...), that is used while bind params, to some Oracle Extended type and add there Oracle Driver API ussage (it's not so private... but it's some Oracle specific extension of JDBC, don't like the way Oracle does it's Drivers but there is nothing better).
Since we don't have Oracle Driver in dependencies we could use reflection.

Already try it, it works :)

Will be small patch for revision soon (today-tomorrow).


> 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
>
>
> 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.


[jira] Updated: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1470:
-----------------------------------

    Attachment: CAY-1470.patch

small draft patch

> 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
>
>
> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895301#action_12895301 ] 

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

To be exact OracleAdapter is using RTRIM , but I suspect that will kill indexes use as well (something to check though)..

Anyways, what are you suggesting? There is no JDBC solution ... We may potentially use oracle driver private APIs (with some driver version  detection ... quoted forum dates back to 2003) for SelectQuery. SQLTemplate is a black box to Cayenne in a way... Maybe experiment using ParameterMetaData for binding type detection? I vaguely remember ParameterMetaData not providing any meaningful data on some other DBs, but that may work on Oracle.



> 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
>
>
> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895967#action_12895967 ] 

Evgeny Ryabitskiy commented on CAY-1470:
----------------------------------------

Tests are done.

this method works fine with VARCHAR.

No performance problems also, even no problems with reflection. We don't need driver.

> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895669#action_12895669 ] 

Evgeny Ryabitskiy commented on CAY-1470:
----------------------------------------

>> This seems wrong. SET_FIXED_CHAR_METHOD.getClass() is "java.lang.refelect.Method" 

Yes! it's wrong, thx

> 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
>
>
> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895644#action_12895644 ] 

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

> SET_FIXED_CHAR_METHOD.getClass().equals(value.getClass())

This seems wrong. SET_FIXED_CHAR_METHOD.getClass() is "java.lang.refelect.Method"  

> 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
>
>
> 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.


[jira] Issue Comment Edited: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895285#action_12895285 ] 

Evgeny Ryabitskiy edited comment on CAY-1470 at 8/4/10 11:15 AM:
-----------------------------------------------------------------

In this case I will lose performance since indexes are not used:

SELECT * FROM tUser WHERE TRIM(Brief) = 'credit'

TABLE ACCESS     FULL



SELECT * FROM tUser WHERE Brief = 'credit'

TABLE ACCESS     BY INDEX ROWID
RANGE SCAN


      was (Author: apparition):
    In this case I will lose performance since I don't use indexes:

SELECT * FROM tUser WHERE TRIM(Brief) = 'credit'

TABLE ACCESS     FULL



SELECT * FROM tUser WHERE Brief = 'credit'

TABLE ACCESS     BY INDEX ROWID
RANGE SCAN

  
> 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
>
>
> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895285#action_12895285 ] 

Evgeny Ryabitskiy commented on CAY-1470:
----------------------------------------

In this case I will lose performance since I don't use indexes:

SELECT * FROM tUser WHERE TRIM(Brief) = 'credit'

TABLE ACCESS     FULL



SELECT * FROM tUser WHERE Brief = 'credit'

TABLE ACCESS     BY INDEX ROWID
RANGE SCAN


> 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
>
>
> 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.


[jira] Commented: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Andrus Adamchik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12895265#action_12895265 ] 

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

You haven't said that explcitly, but I assume you are using SQLTemplate. SQLTemplate is not cross-db by definition. E.g. SelectQuery would have generated SQL like WHERE TRIM(brief) = ? ... In SQLTemplate *you* must do it. If you also want to make it cross-db, use different SQL strings for different DB's within the same query (SQLTemplate allows that). 

I.e. I don't think this is a bug.

> 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
>
>
> 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.


[jira] Updated: (CAY-1470) Oracle: Problem with bind CHAR in select

Posted by "Evgeny Ryabitskiy (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAY-1470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeny Ryabitskiy updated CAY-1470:
-----------------------------------

    Attachment: CAY-1470.patch

Patch + JUnit test

> 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
>
>
> 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.