I'm not fully sure, but this may be caused by the fact that the
'users' property of your object (XWikiRights I guess) was previously
saved with a different data type. Probably something like

xwikidoc <-- xwikiobjects <-- xwikiproperties <-- xwikistringlists

vs.

xwikidoc <-- xwikiobjects <-- xwikiproperties <-- xwikilargestrings

So when XWiki tries to save the 'users' property it sees that it has a
different type (so different database table) than the previously saved
value and thus it throws an exception.

Try to pass a list/array as the value of the property instead of a string.

Hope this helps,
Marius


On Thu, Aug 21, 2014 at 3:21 PM, Paul Libbrecht <[email protected]> wrote:
> any hints?
> paul
>
>
> On 20 août 2014, at 11:37, Paul Libbrecht <[email protected]> wrote:
>
>>
>> Hello XWiki exports,
>>
>> I've been working on a tool to massively import users from a spreadsheets 
>> for curriki.org (still on xwiki 3.5.1) and I am stumbling into an error that 
>> I could not solve thus far:
>>
>>> org.hibernate.StaleObjectStateException: Row was updated or deleted by 
>>> another transaction (or unsaved-value mapping was incorrect): 
>>> [com.xpn.xwiki.objects.LargeStringProperty#<?xml version="1.0" 
>>> encoding="UTF-8"?>
>>> <users>poiapsaodi</users>]
>>
>>
>> (user-name is invented)
>>
>> The users element is that of the xwikiRights object.
>> This exception happens at a saveandcontinue action which is triggered in the 
>> object editor after I (as admin) edit the user. It also happens if the user 
>> is logged in.
>>
>>
>> How can I investigate this?
>> I've tried changing the way I write the object in the following (adding the 
>> "new String") as it was done in the social-login but still no hope:
>>        def rightobj = userDoc.newObject("XWiki.XWikiRights", xcontext);
>>        rightobj.setStringValue("users", new String(userName));
>>        rightobj.setStringValue("allow", new String("1"));
>>        rightobj.setStringValue("levels", new String("edit"));
>>        rightobj.setStringValue("groups", new String(""));
>>
>> Note: at curriki, we use the "virtual xwikiUsers group" since we have quite 
>> an amount of them.
>>
>> Any investigation hint is welcome.
>>
>> paul
>
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to