You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Esteban Franqueiro (JIRA)" <ji...@apache.org> on 2007/10/24 17:41:50 UTC
[jira] Created: (JCR-1187) Asking a property twice for it's stream
returns the same stream instance
Asking a property twice for it's stream returns the same stream instance
------------------------------------------------------------------------
Key: JCR-1187
URL: https://issues.apache.org/jira/browse/JCR-1187
Project: Jackrabbit
Issue Type: Bug
Components: jackrabbit-core
Reporter: Esteban Franqueiro
If you ask a property for it's associated stream twice, even if you don't read from any of the streams, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
I'm attaching a test case wich demostrates the issue.
We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1187) Asking a property twice for it's stream
returns the same stream instance
Posted by "Esteban Franqueiro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Esteban Franqueiro updated JCR-1187:
------------------------------------
Attachment: (was: TestTwoGetStreams.java)
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1187) Asking a property twice for it's stream
returns the same stream instance
Posted by "Esteban Franqueiro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Esteban Franqueiro updated JCR-1187:
------------------------------------
Attachment: TestTwoGetStreams.java
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1187) Asking a property twice for it's
stream returns the same stream instance
Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537527 ]
Felix Meschberger commented on JCR-1187:
----------------------------------------
You are right, but there is a very small point to this: To get a new stream, you have to reaquire the value through Property.getValue(), which is exactly how Property.getStream() is defined. Thus, as a consequence, Property.getStream() MUST always return a new stream.
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1187) Asking a property twice for it's stream
returns the same stream instance
Posted by "Esteban Franqueiro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Esteban Franqueiro updated JCR-1187:
------------------------------------
Attachment: DataStoreTestUtils.java
TestTwoGetStreams.java
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property for it's associated stream twice, even if you don't read from any of the streams, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1187) Asking a property twice for it's stream
returns the same stream instance
Posted by "Esteban Franqueiro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Esteban Franqueiro updated JCR-1187:
------------------------------------
Attachment: (was: TestTwoGetStreams.java)
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1187) Asking a property twice for it's
stream returns the same stream instance
Posted by "Esteban Franqueiro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537642 ]
Esteban Franqueiro commented on JCR-1187:
-----------------------------------------
I agree with you Stefan. This issue has been fixed in our implementation. When JCR-1154 is completed, we'll upload our changes for review... if Thomas doesn't fix the issue first ;)
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1187) Asking a property twice for it's stream
returns the same stream instance
Posted by "Esteban Franqueiro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Esteban Franqueiro updated JCR-1187:
------------------------------------
Attachment: (was: DataStoreTestUtils.java)
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1187) Asking a property twice for it's
stream returns the same stream instance
Posted by "Ryan Kruse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710459#action_12710459 ]
Ryan Kruse commented on JCR-1187:
---------------------------------
We're using 1.5.3 and running into the reuse of an InputStream issue on a stored object. I can't simply reset the stream when using the DbInputStream so I have no acceptable workaround at this point.
Can anyone provide a status on this bug or some pointers?
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1187) Asking a property twice for it's
stream returns the same stream instance
Posted by "angela (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537516 ]
angela commented on JCR-1187:
-----------------------------
hi esteban
the fact that Property.getStream() returns the same stream upon calling the method multiple
times is - from my understanding - how JSR-170 specifies the method:
quote from specification:
"6.2.7 Value
[...]
Once a Value object has been read once using getStream(), all subsequent calls to getStream() will return the same stream object. This may mean, for example, that the stream returned is fully or partially consumed. In order to get a fresh stream the Value object must be reacquired via Property.getValue()."
this also applies to Property.getStream, since this method is defined to be
"A shortcut for Property.getValue().getStream()" (quote from 6.2.4 Property Read Methods)
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1187) Asking a property twice for it's
stream returns the same stream instance
Posted by "Stefan Guggisberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12537637 ]
Stefan Guggisberg commented on JCR-1187:
----------------------------------------
i agree with felix, Property.getStream() must (according to the spec) return a fresh InputStream instance upon every invocation.
therefore it seems to be an issue with the database data store implementation.
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1187) Asking a property twice for it's stream
returns the same stream instance
Posted by "Esteban Franqueiro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Esteban Franqueiro updated JCR-1187:
------------------------------------
Attachment: TestTwoGetStreams.java
DataStoreTestUtils.java
This are updated versions of the same previous tests.
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (JCR-1187) Asking a property twice for it's stream
returns the same stream instance
Posted by "Esteban Franqueiro (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Esteban Franqueiro updated JCR-1187:
------------------------------------
Description:
If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
I'm attaching a test case wich demostrates the issue.
We're working on this and have a potencial fix for it.
was:
If you ask a property for it's associated stream twice, even if you don't read from any of the streams, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
I'm attaching a test case wich demostrates the issue.
We're working on this and have a potencial fix for it.
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (JCR-1187) Asking a property twice for it's
stream returns the same stream instance
Posted by "James Snyder (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674475#action_12674475 ]
James Snyder commented on JCR-1187:
-----------------------------------
To get around this issue using the OCM, I had to clear the OCM request cache to get a new stream. I am using the db data store, but I am not sure why this worked given the description of the bug.
> Asking a property twice for it's stream returns the same stream instance
> ------------------------------------------------------------------------
>
> Key: JCR-1187
> URL: https://issues.apache.org/jira/browse/JCR-1187
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-core
> Reporter: Esteban Franqueiro
> Attachments: DataStoreTestUtils.java, TestTwoGetStreams.java
>
>
> If you ask a property stored in the database data store (JCR-1154) for it's associated stream twice, the stream instance returned is the same. This behavior is not consistent with the file data store, which returns a different stream instance each time Property.getStream() is called.
> I'm attaching a test case wich demostrates the issue.
> We're working on this and have a potencial fix for it.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.