incubator-cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prasanna Santhanam <>
Subject About Transaction management
Date Thu, 23 Aug 2012 14:49:43 GMT
I was looking at moving the Simulator managed entities into a
different database and found that is not able to
switch to the right DB based on context of its execution.

To explain further:

The ServerResource for simulator which is the bottommost layer manages
a set of Daos which alter entities in the database : `simulator`. When
the context goes back to the middle manager layers of CS
(ResourceManagerImpl say) after a Command is executed at the
ServerResource all the Daos in the Managers seem to access the
`simulator` db instead of the `cloud` db for their operations.

I noticed that holds a threadlocal store where it
retains the _previously used database.

1) Is this a bad design for the simulator in that it tries to alter db
entities at the ServerResource?
2) Or is this a bug in the way transactions are managed? 
3) Or is this the wrong way to switch databases?

txn =
try {
		 .... some persistence code here....

		} catch (Exception ex) {


		} finally {





View raw message