[jboss-user] [JBossCache] - Re: newbie question - ReplicationException

2008-02-19 Thread aditsu
bump View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4130606#4130606 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4130606 ___ jboss-user mailing list jboss-user@lists.jboss.org

[jboss-user] [JBossCache] - Re: newbie question - ReplicationException

2008-01-17 Thread aditsu
anonymous wrote : In your case though, perhaps a good approach may be for both caches to attempt to write the change, and if one cache fails to write, assume that this is because the other has completed the write and hence it would not be necessary? That seems like a terrible approach,

[jboss-user] [JBossCache] - Re: Fqns in 3.0.0

2008-01-17 Thread aditsu
Well, if String and the primitives are supported, I think it's enough. If more complex types are really needed, the application code could serialize them to strings before constructing a Fqn. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4121163#4121163 Reply

[jboss-user] [JBossCache] - Re: Upgrading to JBossCache 2.0 question?

2008-01-17 Thread aditsu
anonymous wrote : How can I get the all the objects for given Node? See Node.getData() View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4121164#4121164 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4121164

[jboss-user] [JBossCache] - Re: newbie question - ReplicationException

2008-01-08 Thread aditsu
Hi, I decided to come back to this problem and find a better solution than the random sleeps and retries. We tried using optimistic locking, but it doesn't seem to help at all. Here's a test program, using 2 replicated cache instances and writing to the same node: | package CacheRepl; |

[jboss-user] [JBossCache] - Re: newbie question - ReplicationException

2008-01-08 Thread aditsu
Hm, the forum system ate my reply, I'll try to write it again. In my case, with both locking schemes, both nodes usually fail at the same time (but not always). I don't necessarily want a specific type of locks (e.g. distributed), especially if they're extremely non-scalable. Indeed, this

[jboss-user] [JBossCache] - Child count

2007-12-11 Thread aditsu
Hi, is there a good way to get the number of children of a node? (in JBC 2.0) So far I only found getChildrenNames().size() but I don't think it's very efficient. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4112158#4112158 Reply to the post :

[jboss-user] [JBossCache] - Re: Cache loader questions

2007-11-23 Thread aditsu
Hi, I think you're wrong about point 1. I wrote a simple test: package aditsu; | | import java.io.IOException; | import java.util.HashMap; | import java.util.Map; | | import org.apache.log4j.BasicConfigurator; | import org.jboss.cache.Cache; | import

[jboss-user] [JBossCache] - Re: Passivation and CacheLoader

2007-11-23 Thread aditsu
Just custom code. If you want to use JDBCCacheLoader's table structure, then you can extract the code from JDBCCacheLoader for working with the db, and call it directly. Otherwise, just write your own. I use iBATIS. View the original post :

[jboss-user] [JBossCache] - Re: Passivation and CacheLoader

2007-11-23 Thread aditsu
You can do that by using no cache loader at all. To preload values, just manually get them from the DB and put them in the cache. To persist changes, use a cache listener. At least that's what I did :) Adrian View the original post :

[jboss-user] [JBossCache] - Cache loader questions

2007-11-19 Thread aditsu
Hi, I previously had a lot of issues with cache loaders, so I decided not to use them *at all*, in favor of manual preloading, listeners for persisting changes, and cache replication with memory state transfer. This has worked pretty well, however we're running into problems when trying to

[jboss-user] [JBossCache] - Re: Cache loader questions

2007-11-19 Thread aditsu
Salut, mersi pt. raspuns :) (Hi, thanks for your answer) 1. This is good news, I'll look at the JDBCCacheLoader code For the writes, I already have a custom implementation. 2. This was not answered properly, but from what you say it looks like at least 2.2 is not currently possible. 3. I'm

[jboss-user] [JBossCache] - Queue structure

2007-11-14 Thread aditsu
Hi, is it possible to implement a FIFO queue in the cache, so that multiple threads (or apps) can add and remove elements in order, without conflicting? As I understand it, each node has a (Concurrent)HashMap of child nodes and a HashMap of data. HashMap is not particularly known for keeping the

[jboss-user] [JBossCache] - Re:

2007-11-14 Thread aditsu
Just do all those things within a transaction. Locks should be acquired automatically. Adrian View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4104482#4104482 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4104482

[jboss-user] [JBossCache] - Re: Queue structure

2007-11-14 Thread aditsu
Well, the millisecond precision is probably not good enough, and if several machines are involved then it would require very precise time synchronization. On the other hand, if the queue is kept in a node, then won't every add/remove operation lock the whole node (thus the whole queue)? Adrian

[jboss-user] [JBossCache] - Replication and notifications

2007-11-13 Thread aditsu
Hi, I'm using JBC 2.0.0.GA (core) I set up 2 caches with REPL_SYNC and memory state fetching, and I added a listener to the 2nd cache before starting it. It looks like when fetching the memory state, the cache only fires NODE_CREATED notifications, which contain no data. However, when I put a

[jboss-user] [JBossCache] - Re: Replication and notifications

2007-11-13 Thread aditsu
Yes, the initial transfer. Sorry I wasn't very clear. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4104210#4104210 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4104210 ___

[jboss-user] [JBossCache] - Scalability

2007-10-25 Thread aditsu
Hi, how well does JBC replication scale? How many replicated servers are people running successfully? Are there any issues that appear as the number increases? I'm mainly concerned about synchronous replication, with multicasting, but I'm interested to hear about any kinds of setups. View the

[jboss-user] [JBossCache] - Re: Transactions

2007-10-08 Thread aditsu
Hi, I'm finally coming back to this problem, and I'd like to use a local cache (B) to keep things simple. So far I found 2 ways to do that: 1. What you said - a TcpCacheLoader in B pointing at C, and (I guess) no replication for B 2. B and C synchronously replicated in the same cluster, with no

[jboss-user] [JBossCache] - Re: TransactionManagerLookup in standalone cache

2007-10-08 Thread aditsu
Well, what's wrong with DummyTransactionManagerLookup anyway? Why is it not recommended for production use? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4092823#4092823 Reply to the post :

[jboss-user] [JBossCache] - Re: JBoss Cache 2.0.0 in GA

2007-08-11 Thread aditsu
Great! Shouldn't this be a sticky announcement? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4073290#4073290 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4073290 ___ jboss-user

[jboss-user] [JBossCache] - Re: Should Fqns only contain String elements?

2007-08-11 Thread aditsu
I'm not sure if this is still relevant now, but here's my opinion anyway: I generally agree with genman; at the very least, I think the cache should accept String and Integer elements. Ideally, it should also support Long, Double, Date and enums. View the original post :

[jboss-user] [JBossCache] - Re: API listing for JBoss Cache?

2007-08-03 Thread aditsu
http://labs.jboss.com/jbosscache/docs Scroll to the bottom for the javadocs Adrian View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4070500#4070500 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4070500

[jboss-user] [JBossCache] - Re: Transactions

2007-08-02 Thread aditsu
About distributed TM, I know almost nothing about that, and have no idea where to start. With the local cache (B), if a node is locked for writing in B, will it be also locked for writing in C, at the same time? View the original post :

[jboss-user] [JBossCache] - performance again

2007-08-01 Thread aditsu
I noticed that UnversionedNode.getData() is taking a lot of time in my app. Then I saw that it actually creates a new HashMap, calls getKeys, then gets the value for each key separately and puts it in the map. Every single cache.get(fqn, k) separately fires the whole chain of interceptors...

[jboss-user] [JBossCache] - Re: performance again

2007-08-01 Thread aditsu
Thanks, it runs a tiny little bit faster now :p It jumped from about 350 to 1500 transactions/s (!) About the locks, is ConcurrentHashSet faster than a plain synchronized HashSet, when there are a lot of adds removes? View the original post :

[jboss-user] [JBossCache] - Re: performance again

2007-08-01 Thread aditsu
aditsu wrote : is ConcurrentHashSet faster I meant CopyOnWriteArraySet View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4069879#4069879 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4069879

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-30 Thread aditsu
Hm.. I'm not sure how it's related, but it sounds very good. I updated again from CVS; it seems to work now and doesn't do MapCopy anymore. The performance is still not really great, but it may not be JBC's fault. I'll keep profiling. Thanks for the good work! View the original post :

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-29 Thread aditsu
Thanks, I updated from CVS and the first thing I found is a NPE: java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:846) at java.util.concurrent.ConcurrentHashMap.putAll(ConcurrentHashMap.java:888) at

[jboss-user] [JBossCache] - Re: newbie question - ReplicationException

2007-07-28 Thread aditsu
Yes I found that this can happen. My solution is to have each side time out quickly, wait a random (and short) amount of time, and try again. I don't know if there is a proper solution. Adrian View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4068441#4068441

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-28 Thread aditsu
So.. is this problem going to be solved? Just in case you were waiting, I confirm that I'm using READ_COMMITTED Adrian View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4068442#4068442 Reply to the post :

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-21 Thread aditsu
[EMAIL PROTECTED] wrote : what isolation level are you using? I think it was READ_COMMITTED (I can't see the code right now) View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4066378#4066378 Reply to the post :

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-20 Thread aditsu
Besides that, I also got a bunch of ConcurrentModificationException's while doing a multi-threaded benchmark just now: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841) at java.util.HashMap$EntryIterator.next(HashMap.java:883)

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-20 Thread aditsu
[EMAIL PROTECTED] wrote : http://jira.jboss.com/jira/browse/JBCACHE-1148 | Awesome! I decided to get JBossCache from CVS and try it. I haven't checked the performance, but I still got the concurrency problems: java.util.ConcurrentModificationException at

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-20 Thread aditsu
aditsu wrote : This is not really related to the original message Hm.. or is it? I've just noticed the MapCopy in the trace View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4066123#4066123 Reply to the post : http://www.jboss.com/index.html?module=bbop

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-20 Thread aditsu
Hm, Notifier.copy now thinks the data is unsafe (it's not a MapCopy instance anymore) so it makes a new copy. If I prevent that from happening, the ConcurrentModificationException goes away. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4066132#4066132 Reply

[jboss-user] [JBossCache] - Re: JBC 2 performance

2007-07-19 Thread aditsu
Hi, I've just found a similar problem in CacheImpl: various methods (such as _put) call getDataDirect() on a node, which again does a MapCopy, and slows down the code a lot. This is with 2.0.0.CR3. Can you please check? Thanks Adrian View the original post :

[jboss-user] [JBossCache] - Re: CR3 Listener

2007-07-19 Thread aditsu
I was going to post something along the same lines as FredrikJ, so I'm glad to see this thread. Could we perhaps have an adapter (abstract listener class) with annotated callback methods, that we can extend for defining listeners with compile-time checking? Also, are the listener callbacks

[jboss-user] [JBossCache] - Re: uninitialized nodes

2007-07-12 Thread aditsu
Thanks for the updates and sorry for messing up the jira issue [EMAIL PROTECTED] wrote : | This is not entirely correct since even when you first put a node in the cache, it does need to (try and) load it from the cache loader in case it is not really a new node but one that was evicted. |

[jboss-user] [JBossCache] - Transactions

2007-07-11 Thread aditsu
Let's say I have a machine running a jboss cache (C) and another one running an application (A). A conencts to C through some kind of custom API. How can I make it so that A can call multiple API methods within a single transaction in C? E.g. this could be a scenario: - A starts a transaction -

[jboss-user] [JBossCache] - Re: uninitialized nodes

2007-07-04 Thread aditsu
It looks like the solution to all my problems is *not* to use a cacheloader at all. I was preloading all the data anyway (in a custom and optimized way) so I don't need to load further data, and for storing changes I found that I can use a simple cache listener (the JBC2 CacheListener does a

[jboss-user] [JBossCache] - JBC 2 performance

2007-06-29 Thread aditsu
I wrote some code that used JBC 1.4.1.SP3, then later I converted it to use JBC 2.0.0.CR2, and I noticed that at least a part of it is running MUCH slower. Like, an order of magnitude slower. That part of the code is putting a lot of data in the cache. I ran it with a profiler and a debugger,

[jboss-user] [JBossCache] - Re: uninitialized nodes

2007-06-28 Thread aditsu
In order to call replaceAll, I need to have a Node first. And when I try to get a node, the cache calls the cacheloader to load the data. This is exactly what I want to avoid. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4058574#4058574 Reply to the post :

[jboss-user] [JBossCache] - Fqn element types

2007-06-28 Thread aditsu
I'm using JBC 2.0.0.CR2; the docs for Fqn say that a Fqn is a list of names (typically Strings but can be any Object). However, in CacheLoader, getChildrenNames is declared to return a Set. Besides being inconsistent, this leads to a weird situation where a node's children (with Integer names)

[jboss-user] [JBossCache] - Re: Fqn element types

2007-06-28 Thread aditsu
I mean getChildrenNames is declared to return a Set of String. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4058997#4058997 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4058997

[jboss-user] [JBossCache] - Re: uninitialized nodes

2007-06-28 Thread aditsu
I also found that CacheLoaderInterceptor.loadChildren() actually calls setDataLoaded(false) explicitly on every single child node, ignoring the fact that data was already in memory. It looks like JBC is trying every possible way to make sure that I can never optimize data preloading, and it

[jboss-user] [JBossCache] - Re: uninitialized nodes

2007-06-27 Thread aditsu
You say this data is already in memory, how do you know? Because I first put it myself in the cache. The data map already present in the cache node (I checked with peek) has all the information I need, plus the jboss:internal:uninitialized key which I don't need. When the cache finds that

[jboss-user] [JBossCache] - Re: uninitialized nodes

2007-06-27 Thread aditsu
Don't use the Node object directly in JBC 1.x. Ok, I guess I can use getChildrenNames(), but how can I get the data map of a node? Anyway, I'm already looking at JBC 2, and I found a lot of nice improvements... maybe we'll switch to that. I'll adapt my code to it and see how it behaves. View

[jboss-user] [JBossCache] - Re: uninitialized nodes

2007-06-27 Thread aditsu
Well, I have the same problem with jboss-cache-2.0.0.CR2: I put a node in the cache, but when I try to get it later, it tries to load it from the cacheloader because dataLoaded (in UnversionedNode) is false. How can I solve this? View the original post :

[jboss-user] [JBossCache] - uninitialized nodes

2007-06-26 Thread aditsu
Hi, I'm using jboss-cache 1.4.1.SP3; I'd like to understand when and especially why some nodes are marked as uninitialized. When the app starts, I insert some data into the cache (using put(Fqn, Map)), but it looks like the maps get added an extra key (jboss:internal:uninitialized) which leads

[jboss-user] [JBossCache] - Re: JBossCacheIDE 1.0 Released

2007-06-19 Thread aditsu
Thanks for the reply. I downloaded the version with dependencies, and I'm still getting NPE with no stack trace. I'd like to clarify that I'm doing import new local configuration, and adding some registered jars that it may need. Why is there no stack trace? How can I possibly tell what's the

[jboss-user] [JBossCache] - Re: JBossCacheIDE 1.0 Released

2007-06-19 Thread aditsu
Oops, I ran eclipse from the command line and I can see the full stack trace in the console now. It's from my code, I'll find a way to fix it. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4055879#4055879 Reply to the post :

[jboss-user] [JBossCache] - insert vs update in CacheLoader

2007-06-17 Thread aditsu
Hi, I'm using jboss cache 1.4.1.SP3 and implementing a custom cache loader (that uses a database). How can I tell when a new node is inserted and when an existing node is updated? Right now the only way I found is to query the database for the node's record. I need this information in order to

[jboss-user] [JBossCache] - Re: JBossCacheIDE 1.0 Released

2007-06-17 Thread aditsu
I installed JBossIDE-JBossCacheIDE-nodeps-2.0.0.Beta2 but I can't seem to do anything with it. I tried setting up a local cache with my own configuration, but it failed with an NPE (and NO stack trace), and the remote cache config seems to require JNDI, but I'm not using anything like that

[jboss-user] [JBossCache] - Explicit locking?

2007-05-22 Thread aditsu
I'm using Jboss Cache 1.4.1 SP3 (TreeCache). Is there a way to lock a node explicitly? I want to have a process that contains the cache, and other processes connect to it and perform operations. One desired operation would be get and lock, and another one would be update and release. I saw

[jboss-user] [JBossCache] - Can TreeCache do what I need?

2007-05-16 Thread aditsu
Hi, I'm looking for a caching solution that can do these things: - it should work in a cluster, with a single database used for persistent storage - initially, the caches will preload a specific set of data (different for each cache) - whenever an object is requested from a cache, if it is not