Hello,
I'm trying to set a user's prefix programmatically and this error pops up.
I'm running the report as a user who is "system user" therefore permissions shouldn't be a problem
When I try executing the method manually using the Debug "immediate" window, the behaviour is the following:
The first call fails, the second (and further) call(s) succeed. Apparently, the prefix is set. However, when checking the prefixes (Database > Properties > Identifiers), no prefix is ever created. Even after loggin out / logging in again on the database the list contains only the default "STD" prefix.
What am I missing here? Do the User object needs to be "saved" or "commited" in some way before setting the prefix?
Any ideas?
Thanks in advance!
Hi Kyle,
I have no idea, what might be wrong here. I've tried in a small DB using the system user and it all worked perfectly:
% user.Name(1033)
system
% user.Prefix()
STD
% user.SetPrefix("PREFIXTEST")
true
% user.SetPrefix("PREFIXTEST2")
true
% user.Prefix()
PREFIXTEST2
% user.SetPrefix("PREFIXTEST")
true
% user.Prefix()
PREFIXTEST
%
Does your login user have all needed function privileges? (database management, prefix management, user management)
BR, Torsten
Thanks for your reply.
I do have all required permissions to change prefix. The underlying database (Oracle) may have something to do with this problem... because everything works fine if I test the code in the LOCAL database.
Here is the output log, if someone wants to give it a try:
com.idsscheer.aris.server.bl.common.reportobjects.aris.logic.AOutputWindowLogger log SEVERE: error running User.SetPrefix(TEST): An error occurred in the report object model. cannot save modified objects report-engine-exception: error running User.SetPrefix(TEST): An error occurred in the report object model. cannot save modified objects at com.idsscheer.aris.server.bl.common.reportobjects.aris.logic.AUser.SetPrefix(AUser.java:388) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:154) at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:201) at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3084) at script(Test set user prefix:3) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2250) at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:149) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337) at com.idsscheer.aris.cscommon.webreportbase.javascript.AScriptContextFactory.doTopCall(AScriptContextFactory.java:182) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755) at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:160) at com.idsscheer.aris.cscommon.webreportbase.debugger.backend.AScriptDebugger.startScript(AScriptDebugger.java:177) at com.idsscheer.aris.server.bl.logic.webreport.javascript.interpreter.AJReportDebugger.executeReport(AJReportDebugger.java:88) at com.idsscheer.aris.server.bl.logic.webreport.scripting.AJavaScriptReportThread.run(AJavaScriptReportThread.java:79) at com.idsscheer.aris.server.bl.logic.webreport.scripting.AJavaScriptDebuggerThread.run(AJavaScriptDebuggerThread.java:31) at java.lang.Thread.run(Thread.java:595) Caused by: report-engine-exception: cannot save modified objects at com.idsscheer.aris.server.bl.common.reportobjects.aris.logic.AArisReportRoot.saveModifiedObjects(AArisReportRoot.java:909) at com.idsscheer.aris.server.bl.common.reportobjects.aris.logic.AUser.SetPrefix(AUser.java:380) ... 18 more Caused by: com.idsscheer.aris.server.arisom.base.AAOMException at com.idsscheer.aris.server.arisomimpl.base.ASession.saveModifiedObjects(ASession.java:136) at com.idsscheer.aris.server.bl.common.reportobjects.aris.logic.AArisReportRoot.saveModifiedObjects(AArisReportRoot.java:892) ... 19 more Caused by: DLException: null at com.idsscheer.aris.server.dl.logic.ta.ABaseInternalTransaction.checkUpdateForChangedParents(ABaseInternalTransaction.java:351) at com.idsscheer.aris.server.dl.logic.ta.ATransaction.checkUpdateForChangedParents(ATransaction.java:160) at com.idsscheer.aris.server.dl.logic.jdbcbased.updeng.AUpdateEngine.updateRecords(AUpdateEngine.java:224) at com.idsscheer.aris.server.dl.logic.jdbcbased.updeng.AUpdateEngine.updateRecords(AUpdateEngine.java:113) at com.idsscheer.aris.server.dl.logic.jdbcbased.updeng.AUpdateEngine.updateRecords(AUpdateEngine.java:87) at com.idsscheer.aris.server.dl.logic.jdbcbased.updeng.AUpdateEngine.updateRecords(AUpdateEngine.java:82) at com.idsscheer.aris.server.bl.logic.objectproviderimpl.AObjectProvider.saveRecords(AObjectProvider.java:305) at com.idsscheer.aris.server.arisomimpl.base.ASession.saveModifiedObjects(ASession.java:128) ... 20 more Caused by: java.lang.NullPointerException
By looking at the logs above, this seems to be a very low level problem.
One possible solution is:
1. export db from oracle installation to a LOCAL installation
2. run scripts that change prefix
3. re-import changed db into oracle installation.
Thanks.