On May 25, 2011, at 3:46 PM, Andrus Adamchik wrote:

> Know nothing about Ingres specifically, but when Cayenne runs a SQLTemplate 
> (either selecting or updating, doesn't matter), it calls 
> "Connection.commit()" on JDBC Connection object at the end of the operation.
> 
> Andrus
> 


Interesting.  The behavior I was seeing was that the data was inserted into the 
table when the app was closing.  I'm assuming when the data context when out of 
scope.  I managed to work around this by manually uisng the Transaction class 
as noted here: http://cayenne.apache.org/doc30/understanding-transactions.html 
at the bottom of the page.  

It seemed to work with one transaction created before my main processing loop 
and then commits inside the loop and resets to the state of the transaction 
object so that it would be in ACTIVE.  When using begin, it would try to create 
another connection and crash.  Due to some locking issues, I wanted to keep 
this on a single connection. 

I feel like this is quite hackish compared to the prior work I've done with 
Cayenne + MySQL, but at least it's working. 

Thanks.

Lucas Holt

Reply via email to