[jboss-user] [JBossCache] - Re: JBossCache and readonly transactions

2007-04-19 Thread aricci
- REPLICATION mode replicates everything is put inside the cache. This is bad 
because replicates everything, also objects that have not been modified, 
generating unnecessary traffic.
- INVALIDATION mode tags objects that are out of date. This is bad because 
objects have to be reloaded into cache accessing the database.
I think it would be better an hybrid approach: simply replicate changes.

Andrea

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4038803#4038803

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4038803
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBossCache] - Re: JBossCache and readonly transactions

2007-04-18 Thread aricci
Caching read-only data is a good thing if it is done locally, but i don´t 
understand why should we replicate them to all nodes in the cluster.
Scalability and good performances can be achieved only if we reduce the amount 
of informations sent to the channel. So imagine that a transaction performs a 
SELECT * FROM T, where T is a table containing 1.000.000 of records, this 
transaction would produce an incredible and not necessary traffic on the 
communication channel, decreasing scalability and performances of the all 
cluster. isn´t it?

Andrea

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4038253#4038253

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4038253

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBossCache] - JBossCache transaction isolation levels

2007-04-10 Thread aricci
hi all,
i am testing JBossCache (version 1.4.1.SP3) Transaction Isolation levels. For 
this reason i have developed a simple test application that creates 2 threads 
that concurrently perform local transactions. All the examples have been done 
with Postgres-8.2.1, and everytime i have changed JBossCache Transaction 
Isolation level, i have changed the corresponding one in the database.
Thread 1: looks for a bean with primary key 1 and prints it, then sleeps for 2 
seconds. when it wakes up, looks again for bean with primary key 1 and prints 
it.
Thread 2: creates and persist a bean with primary key 1.
Everytime Thread 1 starts its execution before Thread 2.


  | @TransactionAttribute(TransactionAttributeType.REQUIRED)
  | public void doTransaction(int id) throws Exception {
  | System.out.println(id + : start transaction);
  | 
  | // Thread 2
  | if((id % 2) == 0) {
  | em.persist(new Tx(1, 0, adapt19));
  | System.out.println(id + : inserted 1);
  | } 
  | // Thread 1
  | else {
  | Tx tx = em.find(Tx.class, 1);
  | System.out.println(id + :  + tx);
  | Thread.currentThread().sleep(2000);
  | tx = em.find(Tx.class, 1);
  | System.out.println(id + :  + tx);
  | }
  | 
  | System.out.println(id + : end transaction);
  | } catch(Exception e) {e.printStackTrace();}
  | 

Serializable: ok
Repeatable read: no

  | 1: start tx
  | 2: start tx
  | 1: null
  | 2: inserted 1
  | 2: end tx
  | 1: 1, 0, adapt19 [should be null]
  | 1: end tx
  | 
Read committed: ok
Read uncommitted: no (When trying to test this Isolation level i have inserted 
a delay in Thread 2 to make it commit after Thraed 1)

  | 1: start tx
  | 1: null
  | 2: start tx
  | 2: inserted 1
  | 1: null [shuold be 1, 0, adapt19]
  | 1: end tx
  | 2: end tx
  | 

Now my question is: is there something wrong with JBossCache Transaction 
Isolation levels, or something wrong with my test application?

Thank you very much
Andrea

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4036036#4036036

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4036036
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBossCache] - use of org.hibernate.cache.UpdateTimestamp

2007-04-09 Thread aricci
hi all,
i am using JBossCache (1.4.1.SP3) and i am trying to understand how it works. 
looking at the printDetails() function of the JBossCache bean in the JBoss 
JMX-Console, i have noticed that org.hibernate.cache.UpdateTimestamp..item is 
updated everytime with the timestamp of the last modification of the 
corresponding table. i would like to know why this timestamp is needed by 
JBossCache.

thank you very much
Andrea 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4035756#4035756

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4035756
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBossCache] - JBossCache concurrent transaction management

2007-04-02 Thread aricci
Hi everyone,
i am trying to understand how concurrent transactions are managed by 
JBossCache. I have developed a simple EJB3 application that i am testing on a 
cluster of JBoss-4.0.5 instances. it creates a certain amount of threads that 
perform concurrent modification and creation of EntityBeans on different nodes 
of the cluster, sharing a common DB (PostgreSQL-8.2.1).

several scenarios have arised when two transactions try to concurrently create 
the same EntityBean on different nodes of the cluster:

1) sometimes they stop their execution till a timeout expire (ERROR 
[IdentityLock] write lock for /server/Book/server.Book#4 could not be acquired 
after 15000 ms), when one of them is able to committ its transaction. it looks 
like both are waiting the other to acquire lock: a deadlock that is broken only 
when timeout exception arises.

2) sometimes one of them is aborted because of duplicate key violation (ERROR:  
duplicate key violates unique constraint book_pkey. ERROR 
[JDBCExceptionReporter] Batch entry 0 insert into BOOK (TITLE, AUTHOR, ID) 
values (Fiesta, Hernest Hemingway, 5) was aborted.  Call getNextException to 
see the cause.).

3) sometimes one of them is aborted beacuse of PersistenceException (ERROR: 
PersistenceException, org.hibernate.PersistentObjectException: detached entity 
passed to persist: server.Book).

what i don´t understand is: 
- why exception (1) arises?
- what is the difference between exception (2) and (3)? is that in exception 
(2) transaction is aborted at DB level, when performing INSERT operation, 
instead in exception (3) it is aborted at AS level, when creating the 
EntityBean?

finally i would like to know if it exists a document where it is deeply 
described how transactions are managed by JBossCache inside a cluster.

many thanks
Andrea

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4033618#4033618

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4033618

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBossCache] - Re: JBossCache concurrent transaction management

2007-04-02 Thread aricci
i forgot to specify my JBossCache (version1.4.0.SP1) EntityBeans configuration:
- NodeLockingScheme: PESSIMISTIC
- IsolationLevel: REPEATABLE_READ
- CacheMode: REPL_SYNC

Andrea

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4033638#4033638

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4033638
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Clustering/JBoss] - Cannot persist replicated EntityBeans

2007-03-29 Thread aricci
Hi everyone,
i have a cluster of JBoss instances (version 4.0.5), each of them having its 
own local database copy. I have developed a simple EJB3 application that tryes 
to insert datas inside a database to test the behaviour of JBoss replication. 
The application ends without problems, all datas are written inside local 
database and corresponding EntityBeans are well replicated by JBossCache to 
other nodes, but replicated EntityBeans are not written to database by other 
replicas.

I cannot understand if the problem is that this feature has not yet been 
implemented or there is something wrong with my configuration files.

thank you very much
Andrea

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4032689#4032689

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032689
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - cannot persist replicated entity beans

2007-03-27 Thread aricci
Hi everyone,
i have a cluster of JBoss instances (version 4.0.5), each of them having its 
own local database copy. I have developed a simple EJB3 application that try to 
insert datas inside a database to test the behaviour of JBoss replication. The 
application ends without problems, all datas are written inside local database 
and corresponding EntityBeans are well replicated by JBossCache to other nodes, 
but replicated EntityBeans are not written to database by other replicas.

I cannot understand if the problem is that this feature has not yet been 
implemented or there is something wrong with my configuration files.

thank you very much
Andrea

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4032038#4032038

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032038
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user