You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2007/05/15 17:14:16 UTC

[jira] Created: (DERBY-2652) Clob.setCharacterStream differs between embedded and client driver

Clob.setCharacterStream differs between embedded and client driver
------------------------------------------------------------------

                 Key: DERBY-2652
                 URL: https://issues.apache.org/jira/browse/DERBY-2652
             Project: Derby
          Issue Type: Bug
          Components: JDBC
    Affects Versions: 10.3.0.0
            Reporter: Kristian Waagan


Clob.setCharacterStream behaves differently depending on whether you use the embedded or the client driver.
Sample output from the repro:

(embedded) Initial : 123456789
(embedded) After   : 12__56789

(client)   Initial : 123456789
(client)   After   : 12__

As can be seen, the client driver truncates the Clob value when it writes to it, whereas the embedded driver does not and instead replaces existing characters with those written to the character stream.


(BTW: I know the title is not perfectly accurate, but it got so long when explaining that it is when you actually write to the stream returned by Clob.setCharacterStream the result differs.)

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


[jira] Commented: (DERBY-2652) Clob.setCharacterStream differs between embedded and client driver

Posted by "Øystein Grøvlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496215 ] 

Øystein Grøvlen commented on DERBY-2652:
----------------------------------------

I would assume the behavior should be the same as for Clob.setString.  This isssue was raised in DERBY-1286 and Lance presented the opinion of the expert group in the following thread:
http://www.nabble.com/-jira--Created%3A-%28DERBY-1286%29-Fill-in-Clob-methods-required-for-JDBC3-compliance-tf1553591.html#a4549524
This discussion indicates that the embedded has the right behavior.  (That is also similar to the current client behavior for Blobs.)  

When using locators the client will forward the operation to the server.  Hence, this difference should disappear when locators are enabled for Clobs.

--
Øystein


> Clob.setCharacterStream differs between embedded and client driver
> ------------------------------------------------------------------
>
>                 Key: DERBY-2652
>                 URL: https://issues.apache.org/jira/browse/DERBY-2652
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.3.0.0
>            Reporter: Kristian Waagan
>         Attachments: ClobSetCharacterStreamTest.java
>
>
> Clob.setCharacterStream behaves differently depending on whether you use the embedded or the client driver.
> Sample output from the repro:
> (embedded) Initial : 123456789
> (embedded) After   : 12__56789
> (client)   Initial : 123456789
> (client)   After   : 12__
> As can be seen, the client driver truncates the Clob value when it writes to it, whereas the embedded driver does not and instead replaces existing characters with those written to the character stream.
> (BTW: I know the title is not perfectly accurate, but it got so long when explaining that it is when you actually write to the stream returned by Clob.setCharacterStream the result differs.)

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


[jira] Commented: (DERBY-2652) Clob.setCharacterStream differs between embedded and client driver

Posted by "Øystein Grøvlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506492 ] 

Øystein Grøvlen commented on DERBY-2652:
----------------------------------------

I do not think we should change the behavior between 10.2 releases.  Also, for 10.2 we would have to come up with a different solution that is not based on locators.  

> Clob.setCharacterStream differs between embedded and client driver
> ------------------------------------------------------------------
>
>                 Key: DERBY-2652
>                 URL: https://issues.apache.org/jira/browse/DERBY-2652
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.3.0.0
>            Reporter: Kristian Waagan
>         Attachments: ClobSetCharacterStreamTest.java
>
>
> Clob.setCharacterStream behaves differently depending on whether you use the embedded or the client driver.
> Sample output from the repro:
> (embedded) Initial : 123456789
> (embedded) After   : 12__56789
> (client)   Initial : 123456789
> (client)   After   : 12__
> As can be seen, the client driver truncates the Clob value when it writes to it, whereas the embedded driver does not and instead replaces existing characters with those written to the character stream.
> (BTW: I know the title is not perfectly accurate, but it got so long when explaining that it is when you actually write to the stream returned by Clob.setCharacterStream the result differs.)

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


[jira] Commented: (DERBY-2652) Clob.setCharacterStream differs between embedded and client driver

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506419 ] 

Kristian Waagan commented on DERBY-2652:
----------------------------------------

Shall we do anything about this for 10.2, or is that too late anyway? (introducing "incompatible" behavior between 10.2 releases)
If so, I will close this issue.

> Clob.setCharacterStream differs between embedded and client driver
> ------------------------------------------------------------------
>
>                 Key: DERBY-2652
>                 URL: https://issues.apache.org/jira/browse/DERBY-2652
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.3.0.0
>            Reporter: Kristian Waagan
>         Attachments: ClobSetCharacterStreamTest.java
>
>
> Clob.setCharacterStream behaves differently depending on whether you use the embedded or the client driver.
> Sample output from the repro:
> (embedded) Initial : 123456789
> (embedded) After   : 12__56789
> (client)   Initial : 123456789
> (client)   After   : 12__
> As can be seen, the client driver truncates the Clob value when it writes to it, whereas the embedded driver does not and instead replaces existing characters with those written to the character stream.
> (BTW: I know the title is not perfectly accurate, but it got so long when explaining that it is when you actually write to the stream returned by Clob.setCharacterStream the result differs.)

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


[jira] Commented: (DERBY-2652) Clob.setCharacterStream differs between embedded and client driver

Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2652?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496025 ] 

Kristian Waagan commented on DERBY-2652:
----------------------------------------

Clob.setAsciiStream has the same problem.

The existing repro can be used by replacing setCharacterStream with setAsciiStream, Writer with OutputStream and "_" with 0x5F (or use a char).

Now, what is the correct behavior?

> Clob.setCharacterStream differs between embedded and client driver
> ------------------------------------------------------------------
>
>                 Key: DERBY-2652
>                 URL: https://issues.apache.org/jira/browse/DERBY-2652
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.3.0.0
>            Reporter: Kristian Waagan
>         Attachments: ClobSetCharacterStreamTest.java
>
>
> Clob.setCharacterStream behaves differently depending on whether you use the embedded or the client driver.
> Sample output from the repro:
> (embedded) Initial : 123456789
> (embedded) After   : 12__56789
> (client)   Initial : 123456789
> (client)   After   : 12__
> As can be seen, the client driver truncates the Clob value when it writes to it, whereas the embedded driver does not and instead replaces existing characters with those written to the character stream.
> (BTW: I know the title is not perfectly accurate, but it got so long when explaining that it is when you actually write to the stream returned by Clob.setCharacterStream the result differs.)

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


[jira] Updated: (DERBY-2652) Clob.setCharacterStream differs between embedded and client driver

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

Kristian Waagan updated DERBY-2652:
-----------------------------------

    Attachment: ClobSetCharacterStreamTest.java

Attached repro 'ClobSetCharacterStreamTest.java'.

> Clob.setCharacterStream differs between embedded and client driver
> ------------------------------------------------------------------
>
>                 Key: DERBY-2652
>                 URL: https://issues.apache.org/jira/browse/DERBY-2652
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.3.0.0
>            Reporter: Kristian Waagan
>         Attachments: ClobSetCharacterStreamTest.java
>
>
> Clob.setCharacterStream behaves differently depending on whether you use the embedded or the client driver.
> Sample output from the repro:
> (embedded) Initial : 123456789
> (embedded) After   : 12__56789
> (client)   Initial : 123456789
> (client)   After   : 12__
> As can be seen, the client driver truncates the Clob value when it writes to it, whereas the embedded driver does not and instead replaces existing characters with those written to the character stream.
> (BTW: I know the title is not perfectly accurate, but it got so long when explaining that it is when you actually write to the stream returned by Clob.setCharacterStream the result differs.)

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


[jira] Updated: (DERBY-2652) Clob.setCharacterStream differs between embedded and client driver

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

Kristian Waagan updated DERBY-2652:
-----------------------------------

    Affects Version/s: 10.2.2.0

> Clob.setCharacterStream differs between embedded and client driver
> ------------------------------------------------------------------
>
>                 Key: DERBY-2652
>                 URL: https://issues.apache.org/jira/browse/DERBY-2652
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>         Attachments: ClobSetCharacterStreamTest.java
>
>
> Clob.setCharacterStream behaves differently depending on whether you use the embedded or the client driver.
> Sample output from the repro:
> (embedded) Initial : 123456789
> (embedded) After   : 12__56789
> (client)   Initial : 123456789
> (client)   After   : 12__
> As can be seen, the client driver truncates the Clob value when it writes to it, whereas the embedded driver does not and instead replaces existing characters with those written to the character stream.
> (BTW: I know the title is not perfectly accurate, but it got so long when explaining that it is when you actually write to the stream returned by Clob.setCharacterStream the result differs.)

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


[jira] Closed: (DERBY-2652) Clob.setCharacterStream differs between embedded and client driver

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

Kristian Waagan closed DERBY-2652.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 10.3.0.0

I agree with Øystein and I close the issue as fixed.
Note that the difference in behavior is still there for 10.2, but it has been fixed for 10.3 with the change to locator based LOBs.

> Clob.setCharacterStream differs between embedded and client driver
> ------------------------------------------------------------------
>
>                 Key: DERBY-2652
>                 URL: https://issues.apache.org/jira/browse/DERBY-2652
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.2.2.0, 10.3.0.0
>            Reporter: Kristian Waagan
>             Fix For: 10.3.0.0
>
>         Attachments: ClobSetCharacterStreamTest.java
>
>
> Clob.setCharacterStream behaves differently depending on whether you use the embedded or the client driver.
> Sample output from the repro:
> (embedded) Initial : 123456789
> (embedded) After   : 12__56789
> (client)   Initial : 123456789
> (client)   After   : 12__
> As can be seen, the client driver truncates the Clob value when it writes to it, whereas the embedded driver does not and instead replaces existing characters with those written to the character stream.
> (BTW: I know the title is not perfectly accurate, but it got so long when explaining that it is when you actually write to the stream returned by Clob.setCharacterStream the result differs.)

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