PersistenceManager Cache
I just want to know how the persistence manager maintains cache.
1.When i get the instance of persistence manager,during that time itself,all
the JDO instances will be loaded in cache??
or lazy loading???Like only when a request to get an extent of a JDO
comes,then only the instances will be loaded in cache??
2.How about Query Results??All the results will be loaded and returned or
Lazy loading as you traverse thru the result list??
Srini
See inline:
Srini wrote:
I just want to know how the persistence manager maintains cache.
1.When i get the instance of persistence manager,during that time itself,all
the JDO instances will be loaded in cache??No. The PersistenceManager's cache is a lazy one. It maintains a
growing blob of data.
or lazy loading???Like only when a request to get an extent of a JDO
comes,then only the instances will be loaded in cache??Yes. However, extents can be lazily loaded depending on if your
database supports scrolling resultsets.
2.How about Query Results??All the results will be loaded and returned or
Lazy loading as you traverse thru the result list??Same as an extent.
>
SriniNow here are some things to note:
You can always boot an object from the PersistenceManager's cache...
for example:
Extent e = pm.getExtent (Foo.class, true);
for (Iterator i = e.iterator (); i.hasNext ();)
pm.evict (i.next ());
e.closeAll ();
Should have a small size cache (depending on state before this code block).
Also, we have PersistenceManagerFactory caching which is another layer
below, for those who have bought the feature (which is included in our
enterprise package) which stores objects in a more durable manner.
Stephen Kim
[email protected]
SolarMetric, Inc.
http://www.solarmetric.com
Similar Messages
-
Problems with data cache plugin - The ResultList has been closed
I'm testing out the data cache to see if it helps some of my performance
problems, but I now get lots of exceptions that I didn't get before I
enabled the cache. Here's how I enabled it:
# CACHE
com.solarmetric.kodo.DataCacheClass=com.solarmetric.kodo.runtime.datacache.p
lugins.CacheImpl
com.solarmetric.kodo.RemoteCommitProviderClass=com.solarmetric.kodo.runtime.
event.impl.SingleJVMRemoteCommitProvider
The exception I'm getting follows. I'm curious if anyone has any insight
into what's going on? I'm sure there is a problem with my code, I'm
forgetting to close something or other but since it works fine without the
cache I'm really stuck as to what it is.
Thanks
Michael
22:17:32,792 ERROR ObjectFinder - Exception =
com.solarmetric.kodo.runtime.FatalUserException: The ResultList has been
closed.
NestedThrowables:
com.solarmetric.kodo.runtime.ClosurePoint: Closure point of object held in
embedded stack trace.
com.solarmetric.kodo.runtime.FatalUserException: The ResultList has been
closed.
NestedThrowables:
com.solarmetric.kodo.runtime.ClosurePoint: Closure point of object held in
embedded stack trace.
at
com.solarmetric.kodo.runtime.objectprovider.EagerResultList.checkClosed(Eage
rResultList.java:66)
at
com.solarmetric.kodo.runtime.objectprovider.EagerResultList.get(EagerResultL
ist.java:84)
at
com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList.get(Cac
hingRandomAccessList.java:124)
at java.util.AbstractList$Itr.next(AbstractList.java:416)
at java.util.AbstractList.equals(AbstractList.java:604)
at serp.util.WeakCollection$WeakValue.equals(WeakCollection.java:123)
at java.util.HashMap.eq(HashMap.java:270)
at java.util.HashMap.removeEntryForKey(HashMap.java:525)
at java.util.HashMap.remove(HashMap.java:507)
at java.util.HashSet.remove(HashSet.java:198)
at serp.util.RefValueCollection.removeFilter(RefValueCollection.java:272)
at serp.util.RefValueCollection.remove(RefValueCollection.java:235)
at
com.solarmetric.kodo.runtime.datacache.query.QueryCacheImpl.unregisterClassC
hangeListener(QueryCacheImpl.java:160)
at
com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList.abortCa
ching(CachingRandomAccessList.java:103)
at
com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList.get(Cac
hingRandomAccessList.java:149)
at java.util.AbstractList$Itr.next(AbstractList.java:416)
at java.util.AbstractList.hashCode(AbstractList.java:624)
at serp.util.WeakCollection$WeakValue.<init>(WeakCollection.java:93)
at serp.util.WeakCollection.createRefValue(WeakCollection.java:64)
at serp.util.RefValueCollection.addFilter(RefValueCollection.java:193)
at serp.util.RefValueCollection.add(RefValueCollection.java:166)
at serp.util.RefValueCollection.add(RefValueCollection.java:157)
at
com.solarmetric.kodo.runtime.datacache.query.QueryCacheImpl.registerClassCha
ngeListener(QueryCacheImpl.java:151)
at
com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList.<init>(
CachingRandomAccessList.java:76)
at
com.solarmetric.kodo.runtime.datacache.query.CacheAwareQuery.wrapList(CacheA
wareQuery.java:146)
at
com.solarmetric.kodo.runtime.datacache.query.CacheAwareQuery.execute(CacheAw
areQuery.java:270)
at
com.verideon.veriguard.persistence.ObjectFinder.getObjects(ObjectFinder.java
:62)
at
com.verideon.veriguard.persistence.ObjectFinder.getObject(ObjectFinder.java:
44)
at
com.verideon.veriguard.persistence.ObjectFinder.getRole(ObjectFinder.java:91
at
com.verideon.veriguard.services.VeriguardService.createCustomerAccount(Verig
uardService.java:210)
at
com.verideon.veriguard.services.TestVeriguardServiceMonitors.createTestUser(
TestVeriguardServiceMonitors.java:133)
at
com.verideon.veriguard.services.TestVeriguardServiceMonitors.setUp(TestVerig
uardServiceMonitors.java:80)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
..java:167)
NestedThrowablesStackTrace:
com.solarmetric.kodo.runtime.ClosurePoint: Closure point of object held in
embedded stack trace.
at
com.solarmetric.kodo.runtime.objectprovider.EagerResultList.close(EagerResul
tList.java:78)
at com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.close(JDBCQuery.java:127)
at com.solarmetric.kodo.query.QueryImpl.closeAll(QueryImpl.java:637)
at
com.solarmetric.kodo.runtime.datacache.query.CacheAwareQuery.closeAll(CacheA
wareQuery.java:343)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.closeQueries(Persistence
ManagerImpl.java:934)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.close(PersistenceManager
Impl.java:914)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.close(PersistenceManager
Impl.java:884)
at com.verideon.veriguard.services.PMService.close(PMService.java:120)
at com.verideon.veriguard.services.PMService.close(PMService.java:111)
at
com.verideon.veriguard.services.TestVeriguardServiceMonitors.deleteTestUser(
TestVeriguardServiceMonitors.java:127)
at
com.verideon.veriguard.services.TestVeriguardServiceMonitors.tearDown(TestVe
riguardServiceMonitors.java:103)
at junit.framework.TestCase.runBare(TestCase.java:130)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
..java:167)Michael,
Could you send your test case to [email protected] so that we
can take a look at what's going on to cause this exception?
Thanks,
-Patrick
On Thu, 22 May 2003 17:18:50 -0400, Michael wrote:
I'm testing out the data cache to see if it helps some of my performance
problems, but I now get lots of exceptions that I didn't get before I
enabled the cache. Here's how I enabled it:
# CACHE
com.solarmetric.kodo.DataCacheClass=com.solarmetric.kodo.runtime.datacache.p
lugins.CacheImpl
com.solarmetric.kodo.RemoteCommitProviderClass=com.solarmetric.kodo.runtime.
event.impl.SingleJVMRemoteCommitProvider
The exception I'm getting follows. I'm curious if anyone has any
insight into what's going on? I'm sure there is a problem with my code,
I'm forgetting to close something or other but since it works fine
without the cache I'm really stuck as to what it is.
Thanks
Michael
22:17:32,792 ERROR ObjectFinder - Exception =
com.solarmetric.kodo.runtime.FatalUserException: The ResultList has been
closed.
NestedThrowables:
com.solarmetric.kodo.runtime.ClosurePoint: Closure point of object held
in embedded stack trace.
com.solarmetric.kodo.runtime.FatalUserException: The ResultList has been
closed.
NestedThrowables:
com.solarmetric.kodo.runtime.ClosurePoint: Closure point of object held
in embedded stack trace.
at
com.solarmetric.kodo.runtime.objectprovider.EagerResultList.checkClosed(Eage
rResultList.java:66)
at
com.solarmetric.kodo.runtime.objectprovider.EagerResultList.get(EagerResultL
ist.java:84)
at
com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList.get(Cac
hingRandomAccessList.java:124)
at java.util.AbstractList$Itr.next(AbstractList.java:416) at
java.util.AbstractList.equals(AbstractList.java:604) at
serp.util.WeakCollection$WeakValue.equals(WeakCollection.java:123) at
java.util.HashMap.eq(HashMap.java:270) at
java.util.HashMap.removeEntryForKey(HashMap.java:525) at
java.util.HashMap.remove(HashMap.java:507) at
java.util.HashSet.remove(HashSet.java:198) at
serp.util.RefValueCollection.removeFilter(RefValueCollection.java:272)
at serp.util.RefValueCollection.remove(RefValueCollection.java:235) at
com.solarmetric.kodo.runtime.datacache.query.QueryCacheImpl.unregisterClassC
hangeListener(QueryCacheImpl.java:160)
at
com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList.abortCa
ching(CachingRandomAccessList.java:103)
at
com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList.get(Cac
hingRandomAccessList.java:149)
at java.util.AbstractList$Itr.next(AbstractList.java:416) at
java.util.AbstractList.hashCode(AbstractList.java:624) at
serp.util.WeakCollection$WeakValue.<init>(WeakCollection.java:93) at
serp.util.WeakCollection.createRefValue(WeakCollection.java:64) at
serp.util.RefValueCollection.addFilter(RefValueCollection.java:193) at
serp.util.RefValueCollection.add(RefValueCollection.java:166) at
serp.util.RefValueCollection.add(RefValueCollection.java:157) at
com.solarmetric.kodo.runtime.datacache.query.QueryCacheImpl.registerClassCha
ngeListener(QueryCacheImpl.java:151)
at
com.solarmetric.kodo.runtime.datacache.query.CachingRandomAccessList.<init>(
CachingRandomAccessList.java:76)
at
com.solarmetric.kodo.runtime.datacache.query.CacheAwareQuery.wrapList(CacheA
wareQuery.java:146)
at
com.solarmetric.kodo.runtime.datacache.query.CacheAwareQuery.execute(CacheAw
areQuery.java:270)
at
com.verideon.veriguard.persistence.ObjectFinder.getObjects(ObjectFinder.java
:62)
at
com.verideon.veriguard.persistence.ObjectFinder.getObject(ObjectFinder.java:
44)
at
com.verideon.veriguard.persistence.ObjectFinder.getRole(ObjectFinder.java:91
at
com.verideon.veriguard.services.VeriguardService.createCustomerAccount(Verig
uardService.java:210)
at
com.verideon.veriguard.services.TestVeriguardServiceMonitors.createTestUser(
TestVeriguardServiceMonitors.java:133)
at
com.verideon.veriguard.services.TestVeriguardServiceMonitors.setUp(TestVerig
uardServiceMonitors.java:80)
at junit.framework.TestCase.runBare(TestCase.java:125) at
junit.framework.TestResult$1.protect(TestResult.java:106) at
junit.framework.TestResult.runProtected(TestResult.java:124) at
junit.framework.TestResult.run(TestResult.java:109) at
junit.framework.TestCase.run(TestCase.java:118) at
junit.framework.TestSuite.runTest(TestSuite.java:208) at
junit.framework.TestSuite.run(TestSuite.java:203) at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:167)
NestedThrowablesStackTrace:
com.solarmetric.kodo.runtime.ClosurePoint: Closure point of object held
in embedded stack trace.
at
com.solarmetric.kodo.runtime.objectprovider.EagerResultList.close(EagerResul
tList.java:78)
at
com.solarmetric.kodo.impl.jdbc.query.JDBCQuery.close(JDBCQuery.java:127)
at com.solarmetric.kodo.query.QueryImpl.closeAll(QueryImpl.java:637) at
com.solarmetric.kodo.runtime.datacache.query.CacheAwareQuery.closeAll(CacheA
wareQuery.java:343)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.closeQueries(Persistence
ManagerImpl.java:934)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.close(PersistenceManager
Impl.java:914)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.close(PersistenceManager
Impl.java:884)
at com.verideon.veriguard.services.PMService.close(PMService.java:120)
at com.verideon.veriguard.services.PMService.close(PMService.java:111)
at
com.verideon.veriguard.services.TestVeriguardServiceMonitors.deleteTestUser(
TestVeriguardServiceMonitors.java:127)
at
com.verideon.veriguard.services.TestVeriguardServiceMonitors.tearDown(TestVe
riguardServiceMonitors.java:103)
at junit.framework.TestCase.runBare(TestCase.java:130) at
junit.framework.TestResult$1.protect(TestResult.java:106) at
junit.framework.TestResult.runProtected(TestResult.java:124) at
junit.framework.TestResult.run(TestResult.java:109) at
junit.framework.TestCase.run(TestCase.java:118) at
junit.framework.TestSuite.runTest(TestSuite.java:208) at
junit.framework.TestSuite.run(TestSuite.java:203) at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:392)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:276)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:167)--
Patrick Linskey
SolarMetric Inc. -
PersistenceManager: Saving large amounts of data
Hello,
I am looking for the best way to save/cache songs in my music app after they have been download. I am using the PersistenceManager to save user login info, but what is the best way to save large files (like a 3 meg song(s))? Currently I am storing songs in memory (in an array). It would be convenient if I could just save that array and read it back in as is. But something tells me that isn't the best way. I've looked around but have not found definitive answers.
What are the best practices for saving/reading large files with Flex?
Thanks!
RodActually the way You are storing your song isn't very persistent since you are locating it in RAM memory and it will be cleared after user is close flashPlayer instance and log in again.
You may consider using SharedObject: http://livedocs.adobe.com/flex/3/html/help.html?content=17_Networking_and_communications_6 .html
It capacity is elastic as the user may be asked for allowing more space to store data. -
Delete of collection results in "not managed by this PersistenceManager"
Hello there,
I have a object A with a collection of B objects.
What I do is:
1. I create an A with serveral Bs (and comitt)
2. With a query, I select one B and delete it (and commit)
3. When I now re-query for A and it's Bs I get a
javax.jdo.JDOUserException: The instance "B_Class" is not managed by this
PersistenceManager.
It looks to me as if A and it's related Bs are somewhat cached. The error
goes away if a I do an evictAll() or evict(A) after I've deleted the
specific B instance.
However this is either slow or error-prone.
How do I delete objects so that the integrity of A is not affected?
Regards,
Ingomarhere's the code.
Patrick Linskey wrote:
Yan,
Additionally, it is possible that you set a relation in 'obj' to an
object that is not managed by the PersistenceManager, and then traversed
that relation in your query. Could you please post the code that builds
up and executes the query that you are executing?
-Patrick
Yan Or <[email protected]> writes:
i got this exception when i tried to persist an object and then query
for it in
the same transaction:
[java] javax.jdo.JDOUserException: The instance
"test.TestObject@195d80"
is not managed by this PersistenceManager and therefore cannot be
queried.
[java] at
com.solarmetric.kodo.query.InMemoryExpressionFactory$PathImpl
.eval(InMemoryExpressionFactory.java:452)
[java] at
com.solarmetric.kodo.query.InMemoryExpressionFactory$CompareE
xpression.eval(InMemoryExpressionFactory.java:649)
[java] at
com.solarmetric.kodo.query.InMemoryExpressionFactory$Conditio
nalExpression.eval(InMemoryExpressionFactory.java:588)
[java] at
com.solarmetric.kodo.query.InMemoryExpressionFactory$Expressi
onImpl.execute(InMemoryExpressionFactory.java:552)
[java] at
com.solarmetric.kodo.query.QueryImpl.synchWithTransaction(Que
ryImpl.java:433)
[java] at
com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl
.java:360)
my code looks like this:
PersistenceManager pm = JDOFactory.getPersistenceManager ();
Transaction transaction = pm.currentTransaction ();
transaction.begin ();
pm.makePersistent(obj);
... query for the obj ...
transaction.commit ();
Patrick Linskey [email protected]
SolarMetric Inc. http://www.solarmetric.com -
Does Kodo cache projection queries? All my queries are caching properly,
except for ones that use setResult(), and I'd like them to be cached also.
Here's an example:
PersistenceManager pm = getPM();
extent = pm.getExtent(ConstellationRevenueDAO.class, false);
query = (KodoQuery) pm.newQuery(extent);
query.setResult("max(billingDate)");
date = (Date) query.execute();
The corresponding log entries show a cache miss every time. I've noticed
that when the kodo.datacache.QueryKey has a "cacheable:false", it won't be
cached:
2004-12-10 16:04:49,160 DEBUG [kodo.DataCache] Query cache miss while
looking up key "kodo.datacache.QueryKey@dafa335b[filter:[null],access
path:null,subs:false,ordering:null,ignoreCache:false,startIndex:0,endIndex:0,timeout:-1,cacheable:false]".
2004-12-10 16:04:49,160 DEBUG [kodo.Query] executing query: select
max(billingDate) from
com.stercomm.slp.biztier.persistence.stg.ConstellationRevenueDAO exclude
subclasses
2004-12-10 16:04:49,441 DEBUG [kodo.jdbc.SQL] <t 14300405, conn 30092753>
[281 ms] executing prepstmnt 2954511 SELECT MAX(t0.BES1_BILLINGDATE) FROM
DMMK01.CONSTELLATIONREVENUE t0
2004-12-10 16:04:49,441 DEBUG [kodo.jdbc.JDBC] <t 14300405, conn 30092753>
[0 ms] close
2004-12-10 16:04:59,316 DEBUG [kodo.DataCache] Query cache miss while
looking up key "kodo.datacache.QueryKey@dafa335b[filter:[null],access
path:null,subs:false,ordering:null,ignoreCache:false,startIndex:0,endIndex:0,timeout:-1,cacheable:false]".
2004-12-10 16:04:59,316 DEBUG [kodo.Query] executing query: select
max(billingDate) from
com.stercomm.slp.biztier.persistence.stg.ConstellationRevenueDAO exclude
subclasses
2004-12-10 16:04:59,597 DEBUG [kodo.jdbc.SQL] <t 14300405, conn 723185>
[281 ms] executing prepstmnt 7871956 SELECT MAX(t0.BES1_BILLINGDATE) FROM
DMMK01.CONSTELLATIONREVENUE t0
2004-12-10 16:04:59,613 DEBUG [kodo.jdbc.JDBC] <t 14300405, conn 723185>
[0 ms] closeEric-
Unfortunately, queries that use aggregates, projections, or any
custom result class are not cached. The next version of Kodo
will mention this behavior in the documentation.
In article <cpd3dv$m12$[email protected]>, Eric Long wrote:
Does Kodo cache projection queries? All my queries are caching properly,
except for ones that use setResult(), and I'd like them to be cached also.--
Marc Prud'hommeaux
SolarMetric Inc. -
Multithreaded PersistenceManager
I have been playing around with Kodo for a while and now I am looking
for a good design, which deals with the cooperation between PMs and threads.
My Application has a database backed CORBA server with a thread pool.
Since there are separated data scopes, I thought about using one
multithreaded PM for each scope, taking advantage of the PM's caching
funtionallity.
The following questions I have in mind:
- Is it a good idea in general? Using a singlethreaded PM for each
thread with access to the whole database would imply many refresh()
calls, which made caching less usefull. Moreover the JDOUserException
"The instance ... is not managed by this PersistenceManager" had to be
prevented.
- Even if I set the NontransactionalRead flag, I have to keep different
threads from calling begin() on the same transaction. Is this supported
somehow?
- Does nontransactional reading acctually use the cache of the PM the
objects are associated with?
And finally: Is there documentation concerning the design of
multithreaded JDO applications?
Thanks
AchimIn article <[email protected]>, Achim Oehme wrote:
I have been playing around with Kodo for a while and now I am looking
for a good design, which deals with the cooperation between PMs and threads.
My Application has a database backed CORBA server with a thread pool.
Since there are separated data scopes, I thought about using one
multithreaded PM for each scope, taking advantage of the PM's caching
funtionallity.
The following questions I have in mind:
- Is it a good idea in general? Using a singlethreaded PM for each
thread with access to the whole database would imply many refresh()
calls, which made caching less usefull. Moreover the JDOUserException
"The instance ... is not managed by this PersistenceManager" had to be
prevented.For read-only access, pooling PersistenceManagers can lead to good
performance improvements due to sharing or the cache. Note that a
better solution might be to use Kodo's DataCache (available as a
separate product), which allows you to share a cache between multiple
PersistenceManagers, and enables caches to run in a clustered
environment (with a configurable network cache update mechanism).
- Even if I set the NontransactionalRead flag, I have to keep different
threads from calling begin() on the same transaction. Is this supported
somehow?This is a problem: I would not advise that you share writeable
PersistenceMangers. If you do, any your transactions are fairly atomic,
you can just manually synchronize on it:
public void saveSomeData ()
synchronized (myPM)
myPM.currentTransaction ().begin ();
myPM.doSomeWritingStuff ();
myPM.currentTransaction ().commit ();
- Does nontransactional reading acctually use the cache of the PM the
objects are associated with?Yes, it will use the cache.
And finally: Is there documentation concerning the design of
multithreaded JDO applications?This is more of a design pattern topic, and the number of articles and
whitepapers on JDO design patterns is still pretty small.
Thanks
Achim--
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com -
When does an object gets refreshed, if its state has changed in the cache?
Do I have to use transactional reads for an object to get the changes done
by another web application ?
Thanks
WolfgangHi Marc,
I have a shop system comprised of two web applications where one is for
maintaining the shop and the other for using the shop. When I do changes
to the shop from the one webapp they do not show up in the second, unless
I call refresh. Also, I have to switch off the cache, it seems and do a
flush on the changed objects. There are some questions now:
a) when I call refresh, is the complete state reread regardless whether
there have been changes or not or does it know, when the state has not
changed in the DB ? it is a performance question, I guess.
b) can I use transactional reads to do the refresh automatically ?
c) I noticed that refresh does not do a deep refresh of all the objects
referenced by the one to be refreshed. Is there a way to do this or do I
have to go thru all the objects ?
I asked some questions some time ago in another thread, which might refer
to. I am sorry, if I am not clear enough.
Best regards
Wolfgang
Marc Prud'hommeaux wrote:
Wolfgang-
I take the question to mean that you are wondering how you can refresh
the state of a persistent instance to reflect changes in the data store.
If that is the case, then you can just call
PersistenceManager.refresh(ob) on the object, and the newer values will
be obtained.
If that doesn't help, can you clarify the question a little?
In article <cj7ris$mhr$[email protected]>, Wolfgang Kundrus wrote:
Do I have to use transactional reads for an object to get the changes done
by another web application ?
Thanks
Wolfgang
Marc Prud'hommeaux
SolarMetric Inc. -
I have a situation with RC3 where cached queries appear not to be
getting invalidate when they should.
The data model is this:
- UserSecurity has a Collection of UserAssignments. A UserAssignments
contains a long which is the ID of another persistent instance.
Sequence of events, each in a separate transaction:
1. query UserAssignments where referencedItemId == 1234, get one result.
2. add a new UserAssignment, with its referencedItemId set to 1234, to
the assignments Collection of a persistent UserSecurity instance.
3. repeat the first query, still only one result, the original one.
If I disable caching by commenting out the
com.solarmetric.kodo.DataCacheClass line in kodo.properties, it all
works. It also worked fine with 2.4.
My kodo.properties looks like:
javax.jdo.option.RetainValues: true
javax.jdo.option.RestoreValues: true
javax.jdo.option.Optimistic: true
javax.jdo.option.NontransactionalWrite: false
javax.jdo.option.NontransactionalRead: true
javax.jdo.option.Multithreaded: true
javax.jdo.option.MsWait: 5000
javax.jdo.option.MinPool: 1
javax.jdo.option.MaxPool: 10
javax.jdo.option.IgnoreCache: false
javax.jdo.option.ConnectionUserName: @USER_NAME@
javax.jdo.option.ConnectionURL: jdbc:oracle:thin:@@DB_HOST_NAME@:1521:db1
javax.jdo.option.ConnectionPassword: password
javax.jdo.option.ConnectionDriverName: oracle.jdbc.driver.OracleDriver
javax.jdo.PersistenceManagerFactoryClass:
com.solarmetric.kodo.impl.jdbc.ee.EEPersistenceManagerFactory
com.solarmetric.kodo.impl.jdbc.WarnOnPersistentTypeFailure: true
com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass:
com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory
com.solarmetric.kodo.impl.jdbc.FlatInheritanceMapping: true
com.solarmetric.kodo.impl.jdbc.AutoReturnTimeout: 10
com.solarmetric.kodo.LicenseKey: XXXXXXXXXXXXXXX
com.solarmetric.kodo.EnableQueryExtensions: true
com.solarmetric.kodo.DefaultFetchThreshold: -1
com.solarmetric.kodo.impl.jdbc.DictionaryProperties:NameTruncationVersion=1
com.solarmetric.kodo.ee.ManagedRuntimeProperties=TransactionManagerName=java:/TransactionManager
#com.solarmetric.kodo.DataCacheClass=com.solarmetric.kodo.runtime.datacache.plugins.CacheImpl
com.solarmetric.kodo.RemoteCommitProviderClass=com.solarmetric.kodo.runtime.event.impl.SingleJVMRemoteCommitProvider
com.solarmetric.kodo.DataCacheProperties= CacheSize=5000
com.solarmetric.kodo.impl.jdbc.UseBatchedStatements=true
com.solarmetric.kodo.impl.jdbc.UsePreparedStatements=false
com.solarmetric.kodo.impl.jdbc.StatementCacheMaxSize=100
Thanks for any help you can give.
TomHere's some more info:
Metadata for UserSecurity:
<class name="UserSecurityImpl">
<field name="_assignments">
<collection element-type="UserAssignmentImpl"/>
</field>
</class>
Metadata for the ManagedAssignment:
<class name="ManagedAssignment"
persistence-capable-superclass="au.com.oakton.jcore.application.security.UserAssignmentImpl">
<field name="_managingAssignmentHistoryItems">
<collection element-type="ManagingAssignmentHistoryItem"/>
<extension vendor-name="kodo" key="inverse"
value="_managedAssignment"/>
</field>
</class>
<class name="UserAssignmentImpl"
persistence-capable-superclass="AssignmentImpl">
<class name="AssignmentImpl" persistence-capable-superclass="RoleSetImpl"/>
<class name="RoleSetImpl">
<field name="_roles">
<collection element-type="RoleHistoryItem"/>
</field>
</class>
Code for adding ManagedAssignment to UserSecurityImpl:
public synchronized void addAssignment(ManagedAssignment a, User user)
_assignments.add(a);
Code for querying ManagedAssignments:
public synchronized Collection getAssignmentsForItem(long itemId)
if (itemId == -1)
return Collections.EMPTY_LIST;
Long id = new Long(itemId);
PersistenceManager pm = null;
try
pm = Persistence.getManager();
Query q = pm.newQuery(AssignmentImpl.class);
q.setFilter("_itemId == itemId");
q.declareParameters("Long itemId");
return new ArrayList((Collection) q.execute(id));
finally
Persistence.close(pm); -
Maybe my question is misplaced but i'd like to know if kodo caches
instances rethrieved from database (in the extent) or for this you must
specify a Local Cache class.
I thought that by default kodo dinamically caches the jdo instances and
you must specify a Cache class such as Local Cache only if you use
multiple datasources (and have multiple persistence managers) so this
cache can be used by all datasources concurently. Is this right?Thank you, In case I want to use stateless session beans each time i call
a method in it I must obtain a pm from the pmf in jndi , use it and close
it. So here if I use a LocalCache for the pmf the pm-s that are obtained
from it, can benefit from this general pmf cache and not create one of
their own each time i obtain one and destroy it on close?
Fred Lucas wrote:
In article <ao45kp$b7c$[email protected]>, Dan Bunea wrote:
Maybe my question is misplaced but i'd like to know if kodo caches
instances rethrieved from database (in the extent) or for this you must
specify a Local Cache class.
Kodo JDO always caches instances retrieved from the database on a
per-PersistenceManager basis (or per-Transaction, depending on the settings
of various properties).
You must specify a DataCacheClass in order to cache data at the
PersistenceManagerFactory level, in such a way that it is available for
PMs created from a common PMF.
I thought that by default kodo dinamically caches the jdo instances and
you must specify a Cache class such as Local Cache only if you use
multiple datasources (and have multiple persistence managers) so this
cache can be used by all datasources concurently. Is this right?
Not exactly. The LocalCache helps out whenever you read a common set of
data in multiple PMs created from the same PMF. The distributed DataCache
plugins are necessary if you use multiple JVMs, all pointing to the same
database.
Out-of-the-box, Kodo JDO can only deal with multiple datasources through
federated tables on the database side.
-Fred
Fred Lucas
SolarMetric Inc.
202-595-2064 x1122
http://www.solarmetric.com -
Error Message: Need to purge Cache in Adobe Bridge CC (on PC)
I tried purging using Adobe Bridge by going to Edit/Preferences/Cache then purging, but it becomes non responsive. The error message said the problem files were at Users/(my user name)/AppData/Roaming/Adobe/BridgeCC/Cache. There are 4 files in there that are taking up 124 GB! Can I simply delete these files or will it corrupt my regular files? I tried doing as some other forums suggested and hold the ALT key down when opening Bridge before purging, but no luck.
Yes, you can delete the cache files manually, Just be advised that Bridge will become very, very slow until it finishes rebuilding its caches. Depending on your files, that can take a few minutes or several hours.
A good way of doing it is at night, so you can do it before going to bed and let Bridge rebuild caches overnight.
If you can, save the cache files before deleting them to an external drive, so that you'll have them as backup if something goes wrong. -
When I open up Firefox, I see a row of "loading circles" swishing around. I don't want my browser to do this, because it slows down my internet connection, it's unnecessary 95% of the time (I often keep tabs open just to have quick access to some text), and sometime it's actually detrimental (for example, when the page has changed since the last time I loaded it, but I actually wanted the information from the former state of the page).
How do I fix it so that Firefox uses the cached page instead of trying to load a new one?
To clarify: I want Firefox to load the new page when I visit a bookmark, or click on a link to a page I've seen before, or press the reload button. I just don't want it to do this when all I've done is start up Firefox.
Let the tabs sit there until I tell them to do something! Can anyone help?
Using:
Firefox 9.0.1
Windows XP SP3Yes, but at least the start will be faster and only one tab ta the time is checked on the server.
See also:
*http://kb.mozillazine.org/browser.cache.check_doc_frequency -
Have a problem with Lightroom 5.4. Since the program crashed yesterday it won't launch, it comes up with the message "Lightroom encountered an error when reading its preview cache and needs to quit". " Lightroom will attempt to fix this problem next time it launches". Except that it doesn't, I keep getting the same message and the program closes. Does anyone know what I can do to repair it? Can't back up, can't do anything.
There are dozens of threads in this forum that describe the fix
-
Can someone please let me know how I can fix this error and open my Lightroom? Thanks.
You might be quicker help posting in the LR forum rather than the ACR forum, but I believe the way to fix this is to delete the preview cache.
Find your catalog folder.
Close LR.
Within the catalog folder, delete the FOLDER called Catalog-Name Previews.lrdata
Start LR. -
Can anyone help with the above problem?
Here is your fix: Lightroom says my preview cache is corrupted—how do I fix it? - The Lightroom Queen
-
Outlook autocomplete cache stops working for multiple users at the same time
Hi there
Ever since we upgraded our Exchange 2010 to Exchange 2013 we have had problems with the autocomplete cache in Outlook 2010.
We have 700 users and about once per week I get a call about the autocomplete cache. A few users are on cached mode, but most use online mode. The problem appears on both, but it can usually be corrected by /cleanautocompletecache.
Granted, the autocomplete cache gets corrupted sometimes, but it seems to happen a lot for us. I have noticed that often more than one user experiences the problem at the same time, and, since the problem starting after upgrading Exchange, I suspect that
the issue is with Exchange and not Outlook. Yesterday three users complained about the cache at the same time.
I know how to get a broken cache going again - that is not the issue. The issue is keeping this from happening so often.
Anyone out there able to help?
Thanks!
/AndersHi ,
Based on my knowledge , when you tried to send an email to a recipient in the same exchange organisation then the recipient address will be resolved in to legacy dn value and then that email will be delivered to destination mailbox by pointing towards to
that legacy dn value.
For the external recipients exchange user the smtp address to get it delivered.
For your issue :
Based upon the NDR message , we need to covert those values in to x500 format and add it to respective recipient mailbox as an x500 address.Then These erorrs will happen if the x500 value of the destination recipient is not available on it's maibox
and that would be the cause of the NDR for most of the times.Some time as you said autocomplete cache would get corrupted on the client end but it is very rare.
How to convert NDR to x500 address format :
http://msexchangeguru.com/2012/03/15/x500/
How to avoid getting such kind of NDR'S :
https://www.simple-talk.com/sysadmin/exchange/exchange-e-mail-addresses-and-the-outlook-address-cache/
In case if you don't want the users to use the autocomplete cache when composing the new emails :
In group policy we can use the office templates to disable the below mentioned option.
1.use autocomplete to suggest the names ---> this option will comes under the advanced settings on the outlook client.
In case if you don't want the users to use the autocomplete cache when composing the new emails as well as if you wanted to delete that autocomplete then you need to choose one more option along with the first one.
1.Empty autocomplete cache.
Please reply me if anyhitng is unclear.
Thanks & Regards S.Nithyanandham
Maybe you are looking for
-
Image Processor not working in CS 5
I have installed CS5 Design Premium on my Mac Pro at work. (Had installed the education demo, but it turns out my school doesn't fit Adobe's critereon for eligibility - and doesn't take it back after telling you that) although we have qualified for y
-
NetWeaver Portal and ERP 6.0: BI, ESS/MSS and full Portal on one machine
Hello, with ERP 6.0 you need a EP Core Portal for BI Java. An other EP Core Portal for HCM ECC/MSS. The iViews from this portal you integrate in the main portal via federated portal. But in this scenario i need to much portals and have a lot of maint
-
Hi All, I am new to SAP XI. Can you please let me know if Java and ABAP knowladge are mandatory for working with XI. Regards, Bharath
-
How to take ownership of a folder
I am going back and reviving an old NAS that I used to use. It is a WDC Worldbook edition. The problem I have is that I previously set up several folders with ownership permissions and I have no clue what the logon info is. Is there a way to forceful
-
Satellite X200-22U - FN key driver for Windows 7?
Hi all! I use a Satellite X200-22U notebook, and I want to install Windows 7 32bit on it. The problem is, that my FN key functions don't work. They worked fine with the factory installed Vista, but the multimedia keys were dead. Now, under Win7 my mu