arminw      2005/03/22 06:42:48

  Modified:    src/java/org/apache/ojb/broker/locking Tag: OJB_1_0_RELEASE
                        IsolationLevels.java
               src/java/org/apache/ojb/broker/metadata Tag: OJB_1_0_RELEASE
                        ClassDescriptor.java RepositoryXmlHandler.java
               src/test/org/apache/ojb Tag: OJB_1_0_RELEASE repository.dtd
  Log:
  fix bug with isolation-level handling

  per default the CLD now use the iso-level defined in the DescriptorRepository 
file
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.2   +5 -5      
db-ojb/src/java/org/apache/ojb/broker/locking/Attic/IsolationLevels.java
  
  Index: IsolationLevels.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/locking/Attic/IsolationLevels.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- IsolationLevels.java      19 Feb 2005 21:49:53 -0000      1.1.2.1
  +++ IsolationLevels.java      22 Mar 2005 14:42:48 -0000      1.1.2.2
  @@ -50,7 +50,7 @@
        * Non-Repeatable Reads<br/>
        * Phantom Reads<br/>
        */
  -    public final static int IL_READ_UNCOMMITTED = 0;
  +    public final static int IL_READ_UNCOMMITTED = 2;
   
       /**
        * Numeric constant representing the commited read isolation level.
  @@ -63,7 +63,7 @@
        * Non-Repeatable Reads<br/>
        * Phantom Reads<br/>
        */
  -    public final static int IL_READ_COMMITTED = 1;
  +    public final static int IL_READ_COMMITTED = 3;
   
       /**
        * Numeric constant representing the repeatable read isolation level.
  @@ -74,7 +74,7 @@
        * Allows:<br/>
        * Phantom Reads<br/>
        */
  -    public final static int IL_REPEATABLE_READ = 2;
  +    public final static int IL_REPEATABLE_READ = 5;
   
       /**
        * Numeric constant representing the serializable transactions isolation 
level.
  @@ -85,7 +85,7 @@
        * Allows:<br/>
        * -<br/>
        */
  -    public final static int IL_SERIALIZABLE = 3;
  +    public final static int IL_SERIALIZABLE = 7;
   
       /**
        * Numeric constant representing the optimistic locking isolation level.
  
  
  
  No                   revision
  No                   revision
  1.88.2.13 +3 -2      
db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java
  
  Index: ClassDescriptor.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java,v
  retrieving revision 1.88.2.12
  retrieving revision 1.88.2.13
  diff -u -r1.88.2.12 -r1.88.2.13
  --- ClassDescriptor.java      17 Mar 2005 21:34:19 -0000      1.88.2.12
  +++ ClassDescriptor.java      22 Mar 2005 14:42:48 -0000      1.88.2.13
  @@ -146,7 +146,7 @@
       /**
        * transaction isolation level specified for this class, used in the 
ODMG server
        */
  -    private int m_IsolationLevel = IsolationLevels.IL_READ_UNCOMMITTED;
  +    private int m_IsolationLevel;
       /**
        * the SQL SCHEMA of the underlying table of this class
        */
  @@ -277,6 +277,7 @@
       public ClassDescriptor(DescriptorRepository pRepository)
       {
           m_repository = pRepository;
  +        m_IsolationLevel = pRepository.getDefaultIsolationLevel();
       }
   
   
  
  
  
  1.58.2.6  +7 -2      
db-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java
  
  Index: RepositoryXmlHandler.java
  ===================================================================
  RCS file: 
/home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/RepositoryXmlHandler.java,v
  retrieving revision 1.58.2.5
  retrieving revision 1.58.2.6
  diff -u -r1.58.2.5 -r1.58.2.6
  --- RepositoryXmlHandler.java 19 Feb 2005 21:49:54 -0000      1.58.2.5
  +++ RepositoryXmlHandler.java 22 Mar 2005 14:42:48 -0000      1.58.2.6
  @@ -187,7 +187,12 @@
                           // set isolation-level attribute
                           String isoLevel = 
atts.getValue(tags.getTagById(ISOLATION_LEVEL));
                           if (isDebug) logger.debug("     " + 
tags.getTagById(ISOLATION_LEVEL) + ": " + isoLevel);
  -                        
m_CurrentCLD.setIsolationLevel(LockHelper.getIsolationLevelFor(isoLevel));
  +                        /*
  +                        arminw:
  +                        only when an isolation-level is set in CLD, set it.
  +                        Else the CLD use the default iso-level defined in 
the repository
  +                        */
  +                        if(checkString(isoLevel)) 
m_CurrentCLD.setIsolationLevel(LockHelper.getIsolationLevelFor(isoLevel));
   
                           // set class attribute
                           String classname = 
atts.getValue(tags.getTagById(CLASS_NAME));
  
  
  
  No                   revision
  No                   revision
  1.56.2.4  +3 -2      db-ojb/src/test/org/apache/ojb/repository.dtd
  
  Index: repository.dtd
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/repository.dtd,v
  retrieving revision 1.56.2.3
  retrieving revision 1.56.2.4
  diff -u -r1.56.2.3 -r1.56.2.4
  --- repository.dtd    18 Mar 2005 22:32:46 -0000      1.56.2.3
  +++ repository.dtd    22 Mar 2005 14:42:48 -0000      1.56.2.4
  @@ -355,7 +355,8 @@
        class.
   
        The isolation-level attribute defines the locking isolation level of the
  -    specified class (used by OJB's pessimistic locking api).
  +    specified class (used by OJB's pessimistic locking api). Default is 
"empty String"
  +    to use isolation-level defined on "descriptor-repository" level.
       Note: This does NOT touch the jdbc-level of the connection.
   
        If the proxy attribute is set, proxies are used for all loading 
operations
  @@ -399,7 +400,7 @@
   <!ATTLIST class-descriptor
        class ID #REQUIRED
        isolation-level (read-uncommitted | read-committed | repeatable-read |
  -                      serializable | optimistic | none) "read-uncommitted"
  +                      serializable | optimistic | none) ""
        proxy CDATA #IMPLIED
        proxy-prefetching-limit CDATA #IMPLIED
        schema CDATA #IMPLIED
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to