Page 1 of 1

ContextAdd

Posted: Wed Feb 18, 2009 5:16 pm
by nika85
Hello,

If i use vensim.contextAdd(1); Vensim not recognize me this command. I am working with vendlstc.dll.

Thank you

[Edited on 2-18-2009 by nika85]

Posted: Wed Feb 18, 2009 10:06 pm
by bob@vensim.com
do you mean that the function is returning 0?

Posted: Thu Feb 19, 2009 7:22 am
by nika85
No, don´t recognize me the command, it show me an error message

Posted: Thu Feb 19, 2009 12:11 pm
by bob@vensim.com
From the syntax I assume you are using Java - the function is vensim.ContextAdd and vensim.ContextDrop - the first C is capital.

Posted: Thu Feb 19, 2009 2:38 pm
by nika85
We have get that it recognize the command ContextAdd.

Other question:
We are using multicontext dll and we wanted to know if it is necessary to use threads, and how is it used in servlet?

Thank you

[Edited on 2-19-2009 by nika85]

Posted: Thu Feb 19, 2009 10:19 pm
by bob@vensim.com
If you want to provide responsive web performance you will need to use threads. If you are using Apache it will take care of creating the threads for you, so you only need to keep some information on the connection through cookies or another mechanism. You should also set a timer somewhere to drop contexts after a period of inactivity. You can probably find hints for doing these types of things on Apache or other web server forums.

Posted: Fri Feb 20, 2009 8:18 am
by nika85
Then, we are using Apache Tomcat so we need not enter anything in the code about threads?

And another question:
We are using the command:

Vensim vensim = new Vensim("library");
/**The library load correctly**/

- with CComand:
int cid = vensim.ContextAdd(0);
int r = vensim.CCommand(cid,"SPECIAL>LOADMODEL|c:\\.....\\WORLDAPP.vpm");

-with command
int r = vensim.command("SPECIAL>LOADMODEL|c:\\.....\\WORLDAPP.vpm");

withthe two commands returns 0, and we have the model in the specified path.


thanks for your help

[Edited on 2-20-2009 by nika85]

[Edited on 2-20-2009 by nika85]

Posted: Fri Feb 20, 2009 11:28 am
by bob@vensim.com
Look for the files vensim.err and vensim_ctxt001.err which might be in \system\win32 or in the windows temp directory or under VirtualStore\system\win32 under Vista and these will have more detailed information about errors encountered.

Posted: Fri Feb 20, 2009 11:59 am
by nika85
Ok, thank you.

And the other question:
When we are using Apache Tomcat we need not enter anything in the code about threads?

Thank you very much

Posted: Sat Feb 21, 2009 9:55 am
by nika85
In vensim.err i don´t have anything about load the model, no clues. And vensim_ctxt001.err fle does not exist.

All command returns 0 and the library it is load...
Where can be the problem?

Thank you so much

Posted: Sat Feb 21, 2009 11:39 am
by bob@vensim.com
There may be more than 1 vensim.err file. If ContextAdd function returned a positive number vensim_ctxt001.err will exist. Delete vensim.err then try the application again. If vensim.err does not reappear it is because it is located somewhere else.