[opencms-dev] Duplicate Entry Exception While CmsObject.LoginUser() - Please Help urgent

Govind R rocks2984 at gmail.com
Tue Jun 2 09:32:33 CEST 2009


Hi Nacho and list
I mean say.. when call CmsObject.loginUser()  i want to check the user who
had logged in .

ie.

if(!Cmsoject.currentUser.equals(newuser){
  CmsObj
}

As according to my test case which i sent in first mail.. I have set of
web-applications which will use opencms deployed in jboss with different
instances(Jboss)..
All these will be listening for changes ,so  when they all
start listening they will get files from opencms. so they will be logging
in similar way as shown in test case.

Further more i have opencms code 7.0.3 which i modified
as below org.opencms.db.generic.CmsUserDriver class as below.

 protected synchronized void internalWriteUserInfos(CmsDbContext dbc,
CmsUUID userId, Map additionalInfo)
    throws CmsDataAccessException {

        deleteUserInfos(dbc, userId);
        if (additionalInfo == null) {
            return;
        }
        Iterator itEntries = additionalInfo.entrySet().iterator();
        while (itEntries.hasNext()) {
            Map.Entry entry = (Map.Entry)itEntries.next();
            if ((entry.getKey() != null) && (entry.getValue() != null)) {
                writeUserInfo(dbc, userId, (String)entry.getKey(),
entry.getValue());
            }
        }
    }
But still the problem persists.

Thanks and Regards
Govind R




2009/6/2 Nacho Fernández Orellana <nacho.fernandez.orellana at gmail.com>

> Dear Govind and list,
>
> I am sorry I don't undestand your line
> >Can i check the logged in User from the CmsObject which i cam compare with
> who is logging in.
>
> Anyway, by the very nature of OpenCms, you can find its source code and
> modify it to suit your needs in your own installation (see LGPL license
> terms if in doubt). I remind you that simply having many users logging into
> the workplace with the same username should not be enough to reproduce the
> problem, they are unlikely to log in overlapping that block of code (two
> users after deleting user info and while inserting) loggin manually. We
> reproduced it by "artificial" means (simulating multiple request threads).
>
> If you are willing to modify the core code of OpenCms for your use, just
> download it (there are other posts about getting and compiling OpenCms'
> source), get to the method I mentioned earlier and synchronize either the
> block of code that deletes and then inserts or the method itself. I hope
> this helps. Greetings,
>
> Nacho Fernandez.
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090602/3d2b0b50/attachment.htm>


More information about the opencms-dev mailing list