<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=125533510-20022009><FONT face=Arial
color=#0000ff size=2>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 class=125533510-20022009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=125533510-20022009><FONT face=Arial
color=#0000ff size=2>Jon</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> opencms-dev-bounces@opencms.org
[mailto:opencms-dev-bounces@opencms.org] <B>On Behalf Of </B>Govind
R<BR><B>Sent:</B> 20 February 2009 07:47<BR><B>To:</B>
opencms-dev@opencms.org<BR><B>Subject:</B> [opencms-dev]
cmsObject.getFilesInFolder() return from cache.<BR></FONT><BR></DIV>
<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></BLOCKQUOTE></B></BODY></HTML>