You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2007/09/20 14:13:31 UTC

[jira] Updated: (JCR-862) unsynchronized access on 'itemCache' map in ItemManager

     [ https://issues.apache.org/jira/browse/JCR-862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-862:
------------------------------

    Affects Version/s: 1.2.1
                       1.2.2
                       1.3
                       1.3.1
        Fix Version/s:     (was: 1.4)
                       1.3.2

Merged to the 1.3 branch in revision 577711.

> unsynchronized access on 'itemCache' map in ItemManager 
> --------------------------------------------------------
>
>                 Key: JCR-862
>                 URL: https://issues.apache.org/jira/browse/JCR-862
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.2.1, 1.2.2, 1.2.3, 1.3, 1.3.1
>            Reporter: Tobias Bocanegra
>            Assignee: Stefan Guggisberg
>             Fix For: 1.3.2
>
>         Attachments: ItemManager.patch, stacktrace.txt
>
>
> the access 'itemCache' map in ItemManager is mostly synchronized by not via the ItemStateListener methods:
> [...]
>     public void stateCreated(ItemState created) {
>         ItemImpl item = retrieveItem(created.getId());
>         if (item != null) {
>             item.stateCreated(created);
>         }
>     }
> [...]
>     private ItemImpl retrieveItem(ItemId id) {
>         return (ItemImpl) itemCache.get(id);
>     }
> [...]
> this can result in a corruption of a map (eg subsequent accesses may result in a endless loop).

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


Re: [jira] Updated: (JCR-862) unsynchronized access on 'itemCache' map in ItemManager

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 9/20/07, Thomas Mueller <th...@gmail.com> wrote:
> You have also commented out setAutoCommit(true):
>
> --- BundleDbPersistenceManager
>         con = DriverManager.getConnection(url, user, password);
> -        con.setAutoCommit(true);
> +        //con.setAutoCommit(true);

Hmm, that's correct. It's an accidental change in revision 535830 that
I just merged to the 1.3 branch. I'll merge also the fix from revision
535834.

> In my view this line can be completely removed, as by default
> autoCommit is true anyway (for each database).

It might be set otherwise in some local configuration or even the
database connection string, so I guess it would make sense to
explicitly set the autocommit status.

BR,

Jukka Zitting

Re: [jira] Updated: (JCR-862) unsynchronized access on 'itemCache' map in ItemManager

Posted by Thomas Mueller <th...@gmail.com>.
Hi Jukka,

You have also commented out setAutoCommit(true):

--- BundleDbPersistenceManager
        con = DriverManager.getConnection(url, user, password);
-        con.setAutoCommit(true);
+        //con.setAutoCommit(true);

In my view this line can be completely removed, as by default
autoCommit is true anyway (for each database).

Thomas



On 9/20/07, Jukka Zitting (JIRA) <ji...@apache.org> wrote:
>
>      [ https://issues.apache.org/jira/browse/JCR-862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Jukka Zitting updated JCR-862:
> ------------------------------
>
>     Affects Version/s: 1.2.1
>                        1.2.2
>                        1.3
>                        1.3.1
>         Fix Version/s:     (was: 1.4)
>                        1.3.2
>
> Merged to the 1.3 branch in revision 577711.
>
> > unsynchronized access on 'itemCache' map in ItemManager
> > --------------------------------------------------------
> >
> >                 Key: JCR-862
> >                 URL: https://issues.apache.org/jira/browse/JCR-862
> >             Project: Jackrabbit
> >          Issue Type: Bug
> >          Components: core
> >    Affects Versions: 1.2.1, 1.2.2, 1.2.3, 1.3, 1.3.1
> >            Reporter: Tobias Bocanegra
> >            Assignee: Stefan Guggisberg
> >             Fix For: 1.3.2
> >
> >         Attachments: ItemManager.patch, stacktrace.txt
> >
> >
> > the access 'itemCache' map in ItemManager is mostly synchronized by not via the ItemStateListener methods:
> > [...]
> >     public void stateCreated(ItemState created) {
> >         ItemImpl item = retrieveItem(created.getId());
> >         if (item != null) {
> >             item.stateCreated(created);
> >         }
> >     }
> > [...]
> >     private ItemImpl retrieveItem(ItemId id) {
> >         return (ItemImpl) itemCache.get(id);
> >     }
> > [...]
> > this can result in a corruption of a map (eg subsequent accesses may result in a endless loop).
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>