openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Flush all caches?
Date Fri, 08 Dec 2006 03:33:58 GMT
I've been trying to write some test cases using JPA and can't seem to  
find a way to get OpenJPA to flush the cached beans between  
transactions.  Basically, I've been trying to do this:

void test1() {
   cleanDB
   try {
     beginTx
     testSomething
     commitTx
   } finally {
     rollbackLeftOverTx
   }
}

void test2() {
   cleanDB
   try {
     beginTx
     testSomethingElse
     commitTx
   } finally {
     rollbackLeftOverTx
   }
}

My cleanDB code opens a direct connection to the DB and executes a  
"delete from foo".  I know I could theoretically just use JPA to  
clean the db also, but there are tests where that simply isn't possible.

I also need to know how to force JPA to not cache data between  
transactions for clustered systems.

TIA,

-dain

Mime
View raw message