Hi Jonathan <br><br>Thanks for the reply.<br><br>My other Application is where i create some files which i save to opencms. And from the application code snipped which i pasted trying to read the file created in the application.<br>
<br>is it possible to get always from resources not from cache.<br><br>Please the help<br><br>Regards<br>Govind R <br><br><div class="gmail_quote">On Fri, Feb 20, 2009 at 4:08 PM, Jonathan Woods <span dir="ltr"><<a href="mailto:jonathan.woods@scintillance.com">jonathan.woods@scintillance.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial">You say "from my other application" - what runtime
environment does that have? If it's not running in the same web
application as the code you've written below, then yes - it could be a caching
issue, because OpenCms might choose to go to the database for some operations
but use in-memory caches for others. It isn't enough just to have two
CmsObjects referring to the same OpenCms installation - to be sure of avoiding
caching issues, you have to have obtained the CmsObjects in the same runtime
context.</font></span></div>
<div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial"></font></span> </div>
<div dir="ltr" align="left"><span><font size="2" color="#0000ff" face="Arial">Jon</font></span></div><br>
<blockquote style="border-left: 2px solid rgb(0, 0, 255); padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div dir="ltr" align="left" lang="en-us">
<hr>
<font size="2" face="Tahoma"><b>From:</b> <a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a>
[mailto:<a href="mailto:opencms-dev-bounces@opencms.org" target="_blank">opencms-dev-bounces@opencms.org</a>] <b>On Behalf Of </b>Govind
R<br><b>Sent:</b> 20 February 2009 07:47<br><b>To:</b>
<a href="mailto:opencms-dev@opencms.org" target="_blank">opencms-dev@opencms.org</a><br><b>Subject:</b> [opencms-dev]
cmsObject.getFilesInFolder() return from cache.<br></font><br></div><div><div></div><div class="Wj3C7c">
<div></div>Hello All.<br><br>I have a strange problem when i am using
cmsObject.getFilesInFolder().<br><br>I have OpenCms Version 6.2.3 deployed in
Jboss4.2.0GA<br><br><br>My Test Case:-<br><br>I have my MyBeanLoader as i
using spring and opencms.<br><br><br>MyOperations myOperations =
null;<br>public void testOpencms()<br>
{<br> myOperations = (MyOperations)
MyBeanLoader.getInstance("MyOperations<b></b>");<br>
while(true){<br>
try
{<br>
// Gets the list of files from resource.<br><br>
Vector<CmsFile>
documentsize = myOperations
.getDocumentsFromFolder("MyResource");<br>
System.out.println("Document::"+documentsize
.size());<br><br>
// Checks for the existence of resource.<br><br>
boolean
checkExistsDocument = myOperations
.existsDocument("abc","MyResource");<br>
System.out.println("checkExistsDocument::"+checkExistsDocument);<br>
<br>
// Gets the document<br><br>
byte[] document = myOperations
.getDocument("abc","MyResource");<br>
System.out.println("document
::"+document );<br>
Thread.sleep(10000);<br>
} catch (InterruptedException e)
{<br>
// TODO Auto-generated catch block<br>
e.printStackTrace();<br>
}<br><br>}<br><br>MyOperations is wrapper for
CmsObject and the above api's <b>getDocumentsFromFolder will call
getFilesInFolder of CmsObject</b>,<br><b>getDocument will
call</b><b> </b><b> readFile</b><b> of CmsObject,</b><b>existsDocument
will call existsResource </b><b>of CmsObject.<br></b><br>when i run the test
case i will not be having "<b>abc</b>" file in <b>"MyResource"</b>
folder.<br><br>So the output which i get <br><br><b>Document::</b>"
0<br><b>checkExistsDocument::</b>false<br><b>document </b>::null<br><br>After
some execution i create "<b>abc</b>" file in <b>"MyResource"</b> folder from
my other appilication .<br><br>So the output which i get is
<br><br><b>Document::</b>"
0<br><b>checkExistsDocument::</b>true<br><b>document </b>::@fgdfgdfh<br><br>i
am not able to find why it gives 0 size. <b>i think may be its is returning
the size from cache</b> <br><br>But if i do OpenCms.initCmsObject every
time i get the proper count.Why???<br><br>Can u help me
why.<br><br>Regards<br>Govind R <br><b><br></b></div></div></blockquote></div>
<br><br>
_______________________________________________<br>
This mail is sent to you from the opencms-dev mailing list<br>
To change your list options, or to unsubscribe from the list, please visit<br>
<a href="http://lists.opencms.org/mailman/listinfo/opencms-dev" target="_blank">http://lists.opencms.org/mailman/listinfo/opencms-dev</a><br></blockquote></div><br>