ejb事务管理

java ee规范并没有实现事务的隔离级别,所以要依靠不同的服务器厂商来实现,拿weblogic为例,具体的设置可以参考官方文档
http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs81/ejb/DDreference-ejb-jar.html#1114966

ejb2的设置方式是在weblogic-ejb-jar.xml中设置,方式如下:
<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->   < transaction-isolation >
     
< isolation-level > TRANSACTION_SERIALIZABLE </ isolation-level >
     
< method >
         
< description > test </ description >
        
< ejb-name > Test </ ejb-name >
        
< method-intf > Remote </ method-intf >
        
< method-name > test </ method-name >
        
< method-params >
            
< method-param > aaa </ method-param >
        
</ method-params >
     
</ method >
 
</ transaction-isolation >
说明:
   isolation-level为事务的隔离级别,取值范围为如下:
      TransactionSerializable
      TransactionReadCommitted
      TransactionReadUncommitted
      TransactionRepeatableRead
      TransactionReadCommittedForUpdate
      TransactionReadCommittedForUpdateNoWait
具体说明,可以看这里
http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs81/ejb/DDreference-ejb-jar.html#1219635
   method-intf:取值可以是Home | Remote | Local | Localhome
   其他的参数应该不用详细说明了;

2 ejb3,很简单:用weblogic所实现的注解
@weblogic.javaee.TransactionIsolation(IsolationLevel.READ_COMMITTED)
具体可以参见:
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/ejb30/annotations.html

你可能感兴趣的:(html,oracle,weblogic,javaee,ejb)