[JBossCache] - JBossCache transaction isolation levels
by 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=bb&op=viewtopic&p=4036036#4036036
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036036
19 years
[JBoss Seam] - Re: auto tag completion in eclipse?
by james.williams@jboss.com
For now, using seam-gen with eclipse tooling is a bit clunky, but we showed off nice seam-gen tooling at EclipseCon about 1 month ago. It's currently in development and not available outside SVN. Right now, we are open sourcing the Exadel Professional Developer Suite which includes support for a slew of things outside base Eclipse and Seam like Spring and Struts. Right now, only the richfaces and ajax4jsf stuff has been converted to Open Source. Here's what I recommend:
1. Download Eclipse 3.2.1 from: http://download.eclipse.org/eclipse/downloads/drops/R-3.2.1-200609210945/...
2. Download Exadel 4.0.4 from: http://www.exadel.com/web/portal/download/esp35.
3. Download the jBPM plugin from: http://prdownloads.sourceforge.net/jboss/jBPM-Designer-3.0.12.zip?download
4. Download the Drools plugin from: http://labs.jboss.com/file-access/default/members/jbossrules/downloads/3....
5. Download the Hibernate Tools plugin from: http://prdownloads.sourceforge.net/jboss/HibernateTools-3.2.0.beta8.zip?d...
6. Use the TestNG update site to add a nice TestNG plugin: http://testng.org/doc/download.html
Then, use seam-gen via the command line. A seam-gen plugin will likely be available around the JavaOne time frame. With any luck an RHDS(Red Hat Developer Studio) beta will also be publicly available.
Here's what you'll have with this eclipse workbench:
1. JSF/Ajax tooling with Exadel (This is actually quite good)
2. Rules/jBPM tooling with JBoss plugins
3. TestNG tooling
4. Hibernate tooling
5. Server Tooling to start/stop JBossAS, run in debug mode etc...
6. DB Explorer plugin and a bunch of other stuff that's included in Callisto. The Exadel version is more stable than stock Eclipse+Callisto, IMO.
You will not have:
1. A seam-gen plugin (we showed a pre-alpha version at EclipseCon, but it's not available in binary form yet)
2. A stable, consolidated IDE via a single download. RHDS, due out later this year will provide that.
James
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4036031#4036031
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4036031
19 years