You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by ol...@apache.org on 2004/01/18 15:09:54 UTC

cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata RepositoryXmlHandler.java

olegnitz    2004/01/18 06:09:53

  Modified:    src/java/org/apache/ojb/broker/metadata Tag: OJB_BRANCH_1_0
                        RepositoryXmlHandler.java
  Log:
  Fixed bug: proxy-prfetching-limit attribute didn't affect proxy collections
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.50.2.3  +5 -5      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.50.2.2
  retrieving revision 1.50.2.3
  diff -u -r1.50.2.2 -r1.50.2.3
  --- RepositoryXmlHandler.java	7 Jan 2004 13:02:03 -0000	1.50.2.2
  +++ RepositoryXmlHandler.java	18 Jan 2004 14:09:53 -0000	1.50.2.3
  @@ -537,11 +537,11 @@
                           if (isDebug) logger.debug("     " + tags.getTagById(PROXY_PREFETCHING_LIMIT) + ": " + proxyPrefetchingLimit);
                           if (proxyPrefetchingLimit == null)
   			{
  -                            m_CurrentCLD.setProxyPrefetchingLimit(defProxyPrefetchingLimit);
  +                            m_CurrentORD.setProxyPrefetchingLimit(defProxyPrefetchingLimit);
   			}
   			else
                           {
  -                            m_CurrentCLD.setProxyPrefetchingLimit(Integer.parseInt(proxyPrefetchingLimit));
  +                            m_CurrentORD.setProxyPrefetchingLimit(Integer.parseInt(proxyPrefetchingLimit));
                           }
   
                           // set refresh attribute
  @@ -662,11 +662,11 @@
                           if (isDebug) logger.debug("     " + tags.getTagById(PROXY_PREFETCHING_LIMIT) + ": " + proxyPrefetchingLimit);
                           if (proxyPrefetchingLimit == null)
   			{
  -                            m_CurrentCLD.setProxyPrefetchingLimit(defProxyPrefetchingLimit);
  +                            m_CurrentCOD.setProxyPrefetchingLimit(defProxyPrefetchingLimit);
   			}
   			else
                           {
  -                            m_CurrentCLD.setProxyPrefetchingLimit(Integer.parseInt(proxyPrefetchingLimit));
  +                            m_CurrentCOD.setProxyPrefetchingLimit(Integer.parseInt(proxyPrefetchingLimit));
                           }
   
                           // set refresh attribute
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata RepositoryXmlHandler.java

Posted by Martin Kalén <ma...@curalia.se>.
Martin Kalén wrote:

> The repository.dtd documentation of proxy-prefetching-limit says:
> 
> "If the proxy-prefetching-limit attribute (used with the proxy
> attribute) is set to the value > 0, the collections of objects of this
> class are materialized by groups of the specified size, say when user
> tries to access the first object of the collection, next
> proxy-prefetching-limit objects are loaded by one database query.
> 
> Yet, RepositoryXmlHandler sets defProxyPrefetchingLimit to 50 if it is 
> not specified in the "repository.xml"-file.
> 
> 
> I suggest that the documentation is updated to state that this feature 
> is enabled by default, and that the default limit is 50 objects. (Since 
> this is quite high and reduces the benefit of proxies for "db-heavy" 
> objects.)

I see now that xdocs/repository.xml contains exactly what I asked for. :-)

Hmm... rephrase: I suggest that xdocs/repository.xml and 
src/test/org/apache/ojb/repository.dtd contains the same documentation 
(and that this is the one mentioning proxy-prefetching-limit default of 50).

Cheers,
  Martin

-- 
Martin Kalén
Curalia AB              Web:  http://www.curalia.se
Orrspelsvägen 2B        Mail: info@curalia.se
SE-182 79  Stocksund    Tel:  +46-8-410 064 40


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata RepositoryXmlHandler.java

Posted by Martin Kalén <ma...@curalia.se>.
olegnitz@apache.org wrote:
>                            if (isDebug) logger.debug("     " + tags.getTagById(PROXY_PREFETCHING_LIMIT) + ": " + proxyPrefetchingLimit);
>                            if (proxyPrefetchingLimit == null)
>    			{
>   -                            m_CurrentCLD.setProxyPrefetchingLimit(defProxyPrefetchingLimit);
>   +                            m_CurrentORD.setProxyPrefetchingLimit(defProxyPrefetchingLimit);

The repository.dtd documentation of proxy-prefetching-limit says:

"If the proxy-prefetching-limit attribute (used with the proxy
attribute) is set to the value > 0, the collections of objects of this
class are materialized by groups of the specified size, say when user
tries to access the first object of the collection, next
proxy-prefetching-limit objects are loaded by one database query.

Yet, RepositoryXmlHandler sets defProxyPrefetchingLimit to 50 if it is 
not specified in the "repository.xml"-file.


I suggest that the documentation is updated to state that this feature 
is enabled by default, and that the default limit is 50 objects. (Since 
this is quite high and reduces the benefit of proxies for "db-heavy" 
objects.)

Regards,
  Martin

-- 
Martin Kalén
Curalia AB              Web:  http://www.curalia.se
Orrspelsvägen 2B        Mail: info@curalia.se
SE-182 79  Stocksund    Tel:  +46-8-410 064 40


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org