Atomikos Forum

Setting TM name programmatically, and using Atomikos w/ Hibernat

Hi -- I'm using Atomikos TransactionsEssentials with Hibernate only (no Spring/J2EE/etc).  I see in the docs that tm_unique_name should be set if I'm running "more than one transaction manager against one database".  Does this mean more than one TM inside the same JVM, or more than one TM on the same machine in different JVMs? 

If the latter, is there a way to set the TM name programmatically?  I see in the TransactionsEssentials manual the way to change settings in a standalone environment by creating a UserTransactionService and TSInitInfo, but I haven't found a way to make sure that I get the same UTS that Hibernate is using (to ensure that I'm writing the settings to the same instance that Hibernate will use to create transactions later).  Thanks,

Brian
Brian K Send private email
Wednesday, December 23, 2009
 
 
Hi,

By default the tm name is the IP address of the host machine. So if you run more than one the the same host you should configure the name yourself.

If hibernate is running in the same VM as your config then it should get the same instance - even if it constructs a new bean. Underneath it all goes to the same core service.

HTH
Guy Pardon Send private email
Wednesday, December 23, 2009
 
 
Great, thanks -- it worked perfectly. 

Brian
Brian K Send private email
Monday, December 28, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics