Maybe I should just explain my scenario. :)

Basically I have a tree of accounts who can credit, debit, and view their 
account balances.  They credit and debit by adding an item to their transaction 
log.  Each account balance also has a limit.  So debits need to be monitored 
carefully to ensure the account is not going over it's limit.

I'm creating a balance cache for each account that contains the current balance 
of an account by summing up the accounts transaction log.  This cache is used 
to help speed up viewing of acount balance (which happens every time the user 
loads a page) and to speed up debiting of the account balance by allowing for a 
fast limit check.

When a transaction is added to the log I lock the balance cache object and make 
the adjustments to the cache accordingly instead of recreating the balance 
cache everytime the balance changes.  Debits can occationally happen very 
frequently accross many threads throughout the cluster through scheduled events 
and such.

I don't think the UpgradeException would cause a problem under the above 
scenario.  Where things get bad is that when an account debits from their own 
account a debit (depending upon the type of debit) a debit will also happen to 
the account's parent account and so on all the way to the root of the tree 
accross the cluster.

So, the further up the tree I go, the larger the account tree, and the more 
frequent the debits the more UpgradeExceptions I'm get.

Does that explanation help?  I'm I dumb to be using JBossCache in such a way? :)

anonymous wrote : Multiple writers can still wait. The restriction is only when 
you have multiple simultaneous upgrade lock that will throw exception. 

This comment caught my eye.  Is it possible to obtain a write lock for an 
object without first obtaining a read lock?  I didn't know that was possible 
perhaps that can help my situation.

Mike

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3875818#3875818

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3875818


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to