java - Spring Global transaction vs Local transaction -


while reading through spring transaction documentation see supports both global transactions , local transactions.

  • in simple terms global transaction , local transaction?
  • what advantages of 1 on other? appropriate uses of them?

if use following configuration – mean local transaction?

<tx:annotation-driven transaction-manager="transmanager" />  <bean id="transmanager" class="org.springframework.orm.jpa.jpatransactionmanager">     <property name="entitymanagerfactory" ref="emf" /> </bean> 

i tried searching both in google , stackoverflow, did not resources explaining same in simple terms.

actually there plenty of resources answering first 2 questions, example spring documentation explains local , global transaction , depicts differences in chapter 9.2 motivation. in few words:

global transaction application server managed transaction, allowing work different transactional resources (this might 2 different database, database , message queue, etc)

local transaction resource specific transaction (for example oracle transactions) , application server has nothing them. (the same chapter explains pros , cons of each of them , better explain, suggest give closer look)

answering later question. documentation says jpatransactionmanager capable processing global transactions, looking @ piece of presented code it's hard if it's local or global transaction. same documentation says local single-resource transaction datasourcetransactionmanager should used instead.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -