KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > lutris > appserver > server > sql > DatabaseManagerConfiguration


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  */

20 package com.lutris.appserver.server.sql;
21
22 import org.enhydra.dods.CommonConstants;
23 import org.enhydra.dods.DODS;
24 import org.enhydra.dods.cache.CacheConstants;
25
26 import com.lutris.appserver.server.sql.standard.DriverSpecificConstants;
27 import com.lutris.util.Config;
28
29 /**
30  * DatabaseManagerConfiguration contains parameters about defaults configuration. It reads
31  * these parameters from application's configuration file - defaults section.
32  *
33  * @author Sinisa Milosevic
34  * @version 1.0 01.09.2003.
35  */

36  
37 public class DatabaseManagerConfiguration implements CacheConstants, DriverSpecificConstants {
38     
39
40
41     
42     /**
43      * If table supports lazy-loading, parameter lazyLoading is true, otherwise
44      * false.
45      * Default value is false.
46      */

47     private boolean lazyLoading = CacheConstants.DEFAULT_LAZY_LOADING;
48
49
50     
51     /**
52      * If table supports lazy-loading, parameter lazyLoading is true, otherwise
53      * false.
54      * Default value is false.
55      */

56     private boolean caseSensitive = CacheConstants.DEFAULT_CASE_SENSITIVE;
57     
58
59     
60     /**
61      * Maximal time in miliseconds for Event log.
62      * If query is executed longer that this time, its select statement and
63      * execution time are written to Event log for future analyzes.
64      */

65     private int maxExecuteTime = CacheConstants.DEFAULT_MAX_EXECUTE_TIME;
66     
67     private double reserveFactor = CacheConstants.DEFAULT_RESERVE_FACTOR;
68    
69     private double cachePercentage = CacheConstants.DEFAULT_CACHE_PERCENTAGE;
70    
71     private int maxCacheSize = CacheConstants.DEFAULT_MAX_CACHE_SIZE;
72
73     private int maxSimpleCacheSize = CacheConstants.DEFAULT_MAX_SIMPLE_QUERY_CACHE_SIZE;
74    
75     private int maxComplexCacheSize = CacheConstants.DEFAULT_MAX_COMPLEX_QUERY_CACHE_SIZE;
76     
77     private int maxMultiJoinCacheSize = CacheConstants.DEFAULT_MAX_MULTI_JOIN_QUERY_CACHE_SIZE;
78     
79     private boolean transactionCheck = CacheConstants.DEFAULT_TRANSACTION_CHECK;
80    
81     private boolean deleteCheckVersion = CacheConstants.DEFAULT_DELETE_CHECK_VERSION;
82   
83     private boolean autoSave = CacheConstants.DEFAULT_AUTO_SAVE;
84    
85     private boolean autoSaveCreateVirgin = CacheConstants.DEFAULT_AUTO_SAVE_CREATE_VIRGIN;
86     
87     private boolean autoWrite = CacheConstants.DEFAULT_AUTO_WRITE;
88    
89     private boolean transactionCaches = CacheConstants.DEFAULT_TRANSACTION_CACHES;
90    
91     private int deadlockWaitTime = CacheConstants.DEFAULT_DEADLOCK_READ_TIME;
92    
93     private int deadlockRetryCount = CacheConstants.DEFAULT_DEADLOCK_RETRY_NUMBER;
94    
95     private int queryTimeout = CacheConstants.DEFAULT_QUERY_TIMEOUT;
96    
97     private boolean selectOids = CacheConstants.DEFAULT_SELECT_OIDS;
98
99     private boolean incrementVersions = CacheConstants.DEFAULT_INCREMENT_VERSIONS;
100
101     private int defaultFetchSize = CacheConstants.DEFAULT_DEFAULT_FETCH_SIZE;
102    
103     private boolean initialAllCaches = CacheConstants.DEFAULT_INITIAL_ALL_CACHES;
104     
105     private boolean allReadOnly = CacheConstants.DEFAULT_All_READONLY;
106         
107     private Boolean JavaDoc useCursorName = null;
108  
109     private String JavaDoc userConfigWildcard = null;
110     
111     private String JavaDoc userConfigSingleWildcard = null;
112     
113     private String JavaDoc userConfigSingleWildcardEscape = null;
114     
115     private String JavaDoc userConfigWildcardEscape = null;
116     
117     private String JavaDoc DBTransactionFactoryName = null;
118     
119     private String JavaDoc connectionAllocatorName = null;
120     
121     private String JavaDoc DBConnectionFactoryName = null;
122     
123     private int fullCacheCountLimit = CacheConstants.DEFAULT_FULL_CACHE_COUNT_LIMIT;
124
125     private int initialCacheFetchSize = CacheConstants.DEFAULT_INITIAL_CACHE_FETCH_SIZE;
126
127     private int initialDSCacheSize = CacheConstants.DEFAULT_INITIAL_DS_CACHE_SIZE;
128         
129     private String JavaDoc queryCacheImplClass = null;
130     
131     private String JavaDoc initCachesResultSetType = null;
132     
133     private String JavaDoc initCachesResultSetConcurrency = null;
134     
135     private boolean sqlBatch = CommonConstants.DEFAULT_SQL_BATCH;
136
137     private boolean caseInsensitiveDatabase = CommonConstants.DEFAULT_CASE_INSENSITIVE_DATABASE;
138
139     private Integer JavaDoc queryTimeLimit = CommonConstants.DEFAULT_QUERY_TIME_LIMIT;
140    
141     
142     // - XA Support Parameters-
143

144     private int xaDefaultTimeout = CommonConstants.DEFAULT_XA_DEFAULT_TIMEOUT;
145     
146     private int xaUsageCase = CommonConstants.DEFAULT_XA_USAGE_CASE;
147
148     private String JavaDoc xaTransactonManagerLookupName = CommonConstants.DEFAULT_XA_TM_LOOKUP_NAME;
149     
150     private String JavaDoc xaUserTransactonLookupName = CommonConstants.DEFAULT_XA_USER_TRANSACTION_LOOKUP_NAME;
151     
152     private String JavaDoc xaWrappedTransImplFactory = CommonConstants.DEFAULT_XA_WRAPPED_TRANS_IMPL_FACTORY;
153     
154     private String JavaDoc xaJtaSupport = CommonConstants.DEFAULT_XA_JTA_SUPPORT;
155     
156     // - XA Support -
157

158     private String JavaDoc dodsCacheFactory = CacheConstants.DEFAULT_DODS_CACHE_FACTORY;
159     
160     /**
161      * Returns lazyLoading parameter.
162      *
163      * @return true if the table supports lazy-loading, otherwise false.
164      */

165     public boolean isLazyLoading() {
166         return lazyLoading;
167     }
168
169     /**
170      * Returns CaseSensitive parameter.
171      *
172      * @return value of CaseSensitive parameter.
173      */

174     public boolean getCaseSensitive() {
175         return caseSensitive;
176     }
177
178     /**
179      * Set CaseSensitive parameter to newValue value.
180      *
181      * @param newValue New value for CaseSensitive parameter
182      */

183     public void setCaseSensitive(boolean newValue) {
184         caseSensitive = newValue;
185     }
186
187     
188     /**
189      * Sets lazyLoading parameter to value newlazyLoading.
190      *
191      * @param newlazyLoading New lazy-loading value.
192      */

193     protected void setLazyLoading(boolean newlazyLoading) {
194         lazyLoading = newlazyLoading;
195     }
196
197     /**
198      * Returns maxExecuteTime parameter.
199      *
200      * @return Maximal time in miliseconds for Event log.
201      */

202     public int getMaxExecuteTime() {
203         return maxExecuteTime;
204     }
205     
206     /**
207      * Sets maxExecuteTime parameter to value newMaxExecuteTime.
208      *
209      * @param newMaxExecuteTime New maxExecuteTime value.
210      */

211     protected void setMaxExecuteTime(int newMaxExecuteTime) {
212         maxExecuteTime = newMaxExecuteTime;
213     }
214     
215     /**
216      * Returns maxCacheSize parameter.
217      *
218      * @return Maximal cache size.
219      */

220     public int getMaxCacheSize() {
221         return maxCacheSize;
222     }
223     
224     /**
225      * Sets maxCacheSize parameter to value newMaxCacheSize.
226      *
227      * @param newMaxCacheSize New maxCacheSize value.
228      */

229     protected void setMaxCacheSize(int newMaxCacheSize) {
230         maxCacheSize = newMaxCacheSize;
231     }
232     
233     /**
234      * Returns reserveFactor parameter.
235      *
236      * @return reserveFactor double value
237      */

238     public double getReserveFactor() {
239         return reserveFactor;
240     }
241     
242     /**
243      * Sets reserveFactor parameter to value newReserveFactor.
244      *
245      * @param newReserveFactor New reserveFactor value.
246      */

247     protected void setReserveFactor(double newReserveFactor) {
248         reserveFactor = newReserveFactor;
249     }
250     
251     /**
252      *
253      */

254     protected void setCachePercentage(double percent) {
255         cachePercentage = percent;
256     }
257
258     /**
259      *
260      */

261     public double getCachePercentage() {
262         return cachePercentage;
263     }
264
265     /**
266      * Returns maxComplexCacheSize parameter.
267      *
268      * @return Maximal complex query cache size.
269      */

270     public int getMaxComplexCacheSize() {
271         return maxComplexCacheSize;
272     }
273     
274     /**
275      * Sets maxComplexCacheSize parameter to value newMaxCacheSize.
276      *
277      * @param newMaxCacheSize New newMaxComplexCacheSize value.
278      */

279     protected void setMaxComplexCacheSize(int newMaxCacheSize) {
280         maxComplexCacheSize = newMaxCacheSize;
281     }
282     
283     /**
284      * Returns maxMultiJoinCacheSize parameter.
285      *
286      * @return Maximal complex query cache size.
287      */

288     public int getMaxMultiJoinCacheSize() {
289         return maxMultiJoinCacheSize;
290     }
291     
292     /**
293      * Sets maxMultiJoinCacheSize parameter to value newMaxCacheSize.
294      *
295      * @param newMaxCacheSize New maxMultiJoinCacheSize value.
296      */

297     protected void setMaxMultiJoinCacheSize(int newMaxCacheSize) {
298         maxMultiJoinCacheSize = newMaxCacheSize;
299     }
300     
301     /**
302      * Returns maxSimpleCacheSize parameter.
303      *
304      * @return Maximal cache size.
305      */

306     public int getMaxSimpleCacheSize() {
307         return maxSimpleCacheSize;
308     }
309     
310     /**
311      * Sets maxSimpleCacheSize parameter to value newMaxCacheSize.
312      *
313      * @param newMaxCacheSize New newMaxCacheSize value.
314      */

315     protected void setMaxSimpleCacheSize(int newMaxCacheSize) {
316         maxSimpleCacheSize = newMaxCacheSize;
317     }
318
319     /**
320      * Returns TransactionCheck parameter.
321      *
322      * @return TransactionCheck value.
323      */

324     public boolean getTransactionCheck() {
325         return transactionCheck;
326     }
327     
328     /**
329      * Sets TransactionCheck parameter to value newCheck.
330      *
331      * @param newCheck New TransactionCheck value.
332      */

333     protected void setTransactionCheck(boolean newCheck) {
334         transactionCheck = newCheck;
335     }
336
337     /**
338      * Returns DeleteCheckVersion parameter.
339      *
340      * @return DeleteCheckVersion parameter value.
341      */

342     public boolean getDeleteCheckVersion() {
343         return deleteCheckVersion;
344     }
345     
346     /**
347      * Sets DeleteCheckVersion parameter to value newCheck.
348      *
349      * @param newCheck New DeleteCheckVersion value.
350      */

351     protected void setDeleteCheckVersion(boolean newCheck) {
352         deleteCheckVersion = newCheck;
353     }
354
355     /**
356      * Returns AutoSave parameter.
357      *
358      * @return AutoSave parameter value.
359      */

360     public boolean getAutoSave() {
361         return autoSave;
362     }
363     
364     /**
365      * Sets AutoSave parameter to value newCheck.
366      *
367      * @param newCheck New AutoSave value.
368      */

369     protected void setAutoSave(boolean newCheck) {
370         autoSave = newCheck;
371     }
372     
373     /**
374      * Returns AutoSaveCreateVirgin parameter.
375      *
376      * @return AutoSaveCreateVirgin parameter value.
377      */

378     public boolean getAutoSaveCreateVirgin() {
379         return autoSaveCreateVirgin;
380     }
381     
382     /**
383      * Sets AutoSaveCreateVirgin parameter to value newCheck.
384      *
385      * @param newCheck New AutoSaveCreateVirgin value.
386      */

387     protected void setAutoSaveCreateVirgin(boolean newCheck) {
388         autoSaveCreateVirgin = newCheck;
389     }
390
391     /**
392      * Returns AutoWrite parameter.
393      *
394      * @return AutoWrite parameter value.
395      */

396     public boolean getAutoWrite() {
397         return autoWrite;
398     }
399     
400     /**
401      * Sets AutoWrite parameter to value newCheck.
402      *
403      * @param newCheck New AutoWrite value.
404      */

405     protected void setAutoWrite(boolean newCheck) {
406         autoWrite = newCheck;
407     }
408     
409     /**
410      * Returns TransactionCaches parameter.
411      *
412      * @return TransactionCaches parameter value.
413      */

414     public boolean getTransactionCaches() {
415         return transactionCaches;
416     }
417     
418     /**
419      * Sets TransactionCaches parameter to value newCheck.
420      *
421      * @param newCheck New TransactionCaches value.
422      */

423     protected void setTransactionCaches(boolean newCheck) {
424         transactionCaches = newCheck;
425     }
426     
427     /**
428      * Returns DeadlockWaitTime parameter.
429      *
430      * @return DeadlockWaitTime parameter value.
431      */

432     public int getDeadlockWaitTime() {
433         return deadlockWaitTime;
434     }
435     
436     /**
437      * Sets DeadlockWaitTime parameter to value waitTime.
438      *
439      * @param waitTime New DeadlockWaitTime value.
440      */

441     protected void setDeadlockWaitTime(int waitTime) {
442         deadlockWaitTime = waitTime;
443     }
444     
445     /**
446      * Returns DeadlockRetryCount parameter.
447      *
448      * @return DeadlockRetryCount parameter value.
449      */

450     public int getDeadlockRetryCount() {
451         return deadlockRetryCount;
452     }
453     
454     /**
455      * Sets DeadlockRetryCount parameter to value newValue.
456      *
457      * @param newValue New DeadlockRetryCount value.
458      */

459     protected void setDeadlockRetryCount(int newValue) {
460         deadlockRetryCount = newValue;
461     }
462     
463     /**
464      * Returns QueryTimeout parameter.
465      *
466      * @return QueryTimeout parameter value.
467      */

468     public int getQueryTimeout() {
469         return queryTimeout;
470     }
471     
472     /**
473      * Sets QueryTimeout parameter to value newValue.
474      *
475      * @param newValue New QueryTimeout value.
476      */

477     protected void setQueryTimeout(int newValue) {
478         queryTimeout = newValue;
479     }
480     
481     /**
482      * Returns selectOids parameter.
483      *
484      * @return selectStatement parameter value.
485      */

486     public boolean getSelectOids() {
487         return selectOids;
488     }
489     
490     /**
491      * Sets selectOids parameter.
492      *
493      * @param newValue New selectOids value.
494      */

495     protected void setSelectOids(boolean newValue) {
496         selectOids = newValue;
497     }
498
499
500
501     /**
502      * Returns IncrementVersions parameter.
503      *
504      * @return IncrementVersions parameter value.
505      */

506     public boolean getIncrementVersions() {
507         return incrementVersions;
508     }
509     
510     /**
511      * Sets IncrementVersions parameter.
512      *
513      * @param newValue New IncrementVersions value.
514      */

515     protected void setIncrementVersions(boolean newValue) {
516         incrementVersions = newValue;
517     }
518     /**
519      * Returns DefaultFetchSize parameter.
520      *
521      * @return DefaultFetchSize parameter value.
522      */

523     public int getDefaultFetchSize() {
524         return defaultFetchSize;
525     }
526     
527     /**
528      * Sets DefaultFetchSize parameter to value newValue.
529      *
530      * @param newValue New DefaultFetchSize value.
531      */

532     protected void setDefaultFetchSize(int newValue) {
533         defaultFetchSize = newValue;
534     }
535     
536     /**
537      * Returns InitAllCaches parameter.
538      *
539      * @return InitAllCaches parameter value.
540      */

541     public boolean getInitAllCaches() {
542         return initialAllCaches;
543     }
544     
545     /**
546      * Sets InitAllCaches parameter to value newValue.
547      *
548      * @param newValue New InitAllCaches value.
549      */

550     protected void setInitAllCaches(boolean newValue) {
551         initialAllCaches = newValue;
552     }
553     
554     
555     /**
556      * Returns UseCursorName parameter.
557      *
558      * @return Returns UseCursorName parameter.
559      */

560     public Boolean JavaDoc getUseCursorName() {
561         return useCursorName;
562     }
563
564     /**
565      * Sets UseCursorName parameter to value newValue.
566      *
567      * @param newValue New UseCursorName value.
568      */

569     public void setUseCursorName(boolean newValue) {
570         useCursorName =new Boolean JavaDoc(newValue);
571     }
572
573     /**
574      * Sets UseCursorName parameter to value newValue.
575      *
576      * @param newValue New UseCursorName value.
577      */

578     public void setUseCursorName(Boolean JavaDoc newValue) {
579         useCursorName =newValue;
580     }
581     
582     /**
583      * Returns UserConfigSingleWildcard parameter.
584      *
585      * @return Returns UserConfigSingleWildcard parameter.
586      */

587     public String JavaDoc getUserConfigSingleWildcard() {
588         return userConfigSingleWildcard;
589     }
590
591     /**
592      * Returns UserConfigSingleWildcardEscape parameter.
593      *
594      * @return Returns UserConfigSingleWildcardEscape parameter.
595      */

596     public String JavaDoc getUserConfigSingleWildcardEscape() {
597         return userConfigSingleWildcardEscape;
598     }
599
600     /**
601      * Returns UserConfigWildcard parameter.
602      *
603      * @return Returns UserConfigWildcard parameter.
604      */

605     public String JavaDoc getUserConfigWildcard() {
606         return userConfigWildcard;
607     }
608
609     /**
610      * Returns UserConfigWildcardEscape parameter.
611      *
612      * @return Returns UserConfigWildcardEscape parameter.
613      */

614     public String JavaDoc getUserConfigWildcardEscape() {
615         return userConfigWildcardEscape;
616     }
617
618     /**
619      * Sets UserConfigSingleWildcard parameter to value string.
620      * @param newValue New value for UserConfigSingleWildcard
621      */

622     public void setUserConfigSingleWildcard(String JavaDoc newValue) {
623         userConfigSingleWildcard = newValue;
624     }
625
626     /**
627      * Sets UserConfigSingleWildcardEscape parameter to value string.
628      * @param newValue New value for UserConfigSingleWildcardEscape
629      */

630     public void setUserConfigSingleWildcardEscape(String JavaDoc newValue) {
631         userConfigSingleWildcardEscape = newValue;
632     }
633
634     /**
635      * Sets UserConfigWildcard parameter to value string.
636      * @param newValue New value for UserConfigWildcard
637      */

638     public void setUserConfigWildcard(String JavaDoc newValue) {
639         userConfigWildcard = newValue;
640     }
641
642     /**
643      * Sets UserConfigWildcardEscape parameter to value string.
644      * @param newValue New value for UserConfigWildcardEscape
645      */

646     public void setUserConfigWildcardEscape(String JavaDoc newValue) {
647         userConfigWildcardEscape = newValue;
648     }
649     
650     /**
651      * Returns AllReadOnly parameter.
652      *
653      * @return Returns AllReadOnly parameter.
654      */

655     public boolean isAllReadOnly() {
656         return allReadOnly;
657     }
658
659     /**
660      * Sets AllReadOnly parameter to value string.
661      * @param newValue New value for AllReadOnly
662      */

663
664     public void setAllReadOnly(boolean newValue) {
665         allReadOnly = newValue;
666     }
667     
668     
669     /**
670      * @return
671      */

672     public String JavaDoc getDBTransactionFactoryName() {
673         return DBTransactionFactoryName;
674     }
675
676
677     /**
678      * @param string
679      */

680     public void setDBTransactionFactoryName(String JavaDoc string) {
681         DBTransactionFactoryName = string;
682     }
683
684     
685     
686     /**
687      * @return
688      */

689     public String JavaDoc getConnectionAllocatorName() {
690         return connectionAllocatorName;
691     }
692
693
694     /**
695      * @param string
696      */

697     public void setConnectionAllocatorName(String JavaDoc string) {
698         connectionAllocatorName = string;
699     }
700
701     public int getFullCacheCountLimit() {
702         return fullCacheCountLimit;
703     }
704
705     /**
706      * @param i New SimpleCacheCountLimit value;
707      */

708     public void setFullCacheCountLimit(int i) {
709         fullCacheCountLimit = i;
710     }
711
712
713     /**
714      * Reads table configuration parameters.
715      *
716      */

717     public void readDatabaseManagerConfiguration() {
718         Config databaseConfig = null;
719         
720         Config userConfig = null;
721         try {
722             userConfig = (Config) DODS.getDatabaseManager().getConfig().getSection("DB.User");
723         }catch(Exception JavaDoc e){}
724
725         if (userConfig != null) {
726             try{
727                 userConfigWildcard=userConfig.getString("userWildcard");
728             }catch(Exception JavaDoc e){}
729             try{
730                 userConfigSingleWildcard=userConfig.getString("userSingleWildcard");
731             }catch(Exception JavaDoc e){}
732
733             try{
734                 userConfigSingleWildcardEscape=userConfig.getString("userSingleWildcardEscape");
735             }catch(Exception JavaDoc e){}
736
737             try{
738                 userConfigWildcardEscape=userConfig.getString("userWildcardEscape");
739             }catch(Exception JavaDoc e){}
740
741         }
742
743         try {
744             databaseConfig = (Config) DODS.getDatabaseManager().getConfig().getSection("defaults");
745         } catch (Exception JavaDoc ex) {}
746         if (databaseConfig != null) {
747             try {
748                 allReadOnly = databaseConfig.getBoolean(PARAMNAME_ALL_READ_ONLY);
749             } catch (Exception JavaDoc e) {}
750             try {
751                 lazyLoading = databaseConfig.getBoolean(PARAMNAME_LAZY_LOADING);
752             } catch (Exception JavaDoc e) {}
753             try {
754                 caseSensitive = databaseConfig.getBoolean(PARAMNAME_CASE_SENSITIVE);
755             } catch (Exception JavaDoc e) {}
756             try {
757                 maxExecuteTime = databaseConfig.getInt(PARAMNAME_MAX_EXECUTE_TIME);
758             } catch (Exception JavaDoc e) {}
759             try {
760                 transactionCheck = databaseConfig.getBoolean(PARAMNAME_TRANSACTION_CHECK);
761             } catch (Exception JavaDoc e) {}
762             try {
763                 deleteCheckVersion = databaseConfig.getBoolean(PARAMNAME_DELETE_CHECK_VERSION);
764             } catch (Exception JavaDoc e) {}
765             try {
766                 autoSave = databaseConfig.getBoolean(PARAMNAME_AUTO_SAVE);
767             } catch (Exception JavaDoc e) {}
768             try {
769                 autoSaveCreateVirgin = databaseConfig.getBoolean(PARAMNAME_AUTO_SAVE_CREATE_VIRGIN);
770             } catch (Exception JavaDoc e) {}
771             try {
772                 autoWrite = databaseConfig.getBoolean(PARAMNAME_AUTO_WRITE);
773             } catch (Exception JavaDoc e) {}
774             try {
775                 transactionCaches = databaseConfig.getBoolean(PARAMNAME_TRANSACTION_CACHES);
776             } catch (Exception JavaDoc e) {}
777             try {
778                 deadlockWaitTime = databaseConfig.getInt(PARAMNAME_DEADLOCK_READ_TIME);
779             } catch (Exception JavaDoc e) {}
780             try {
781                 deadlockRetryCount = databaseConfig.getInt(PARAMNAME_DEADLOCK_RETRY_NUMBER);
782             } catch (Exception JavaDoc e) {}
783             try {
784                 queryTimeout = databaseConfig.getInt(PARAMNAME_QUERY_TIMEOUT);
785             } catch (Exception JavaDoc e) {}
786             try {
787                 selectOids = databaseConfig.getBoolean(PARAMNAME_SELECT_OIDS);
788             } catch (Exception JavaDoc e) {}
789             try {
790                 incrementVersions = databaseConfig.getBoolean(PARAMNAME_INCREMENT_VERSIONS);
791             } catch (Exception JavaDoc e) {}
792             try {
793                 defaultFetchSize = databaseConfig.getInt(PARAMNAME_DEFAULT_FETCH_SIZE);
794             } catch (Exception JavaDoc e) {}
795             try {
796                 boolean tmpUCrN = databaseConfig.getBoolean(PARAMNAME_USE_CURSOR_NAME);
797                 useCursorName = new Boolean JavaDoc(tmpUCrN);
798             } catch (Exception JavaDoc e) {
799                 useCursorName = null;
800             }
801             try {
802                 DBTransactionFactoryName = databaseConfig.getString(CommonConstants.TRANSACTION_FACTORY);
803             } catch (Exception JavaDoc e) {
804                 DBTransactionFactoryName = null;
805             }
806             try {
807                 queryCacheImplClass = databaseConfig.getString(CommonConstants.QUERY_CACAHE_IMPL_CLASS);
808             } catch (Exception JavaDoc e) {
809                 queryCacheImplClass = null;
810             }
811             try {
812                 connectionAllocatorName = databaseConfig.getString(CommonConstants.CONNECTION_ALLOCATOR);
813             } catch (Exception JavaDoc e) {
814                 connectionAllocatorName = null;
815             }
816             try {
817                 DBConnectionFactoryName = databaseConfig.getString(CommonConstants.CONNECTION_FACTORY);
818             } catch (Exception JavaDoc e) {
819                 DBConnectionFactoryName = null;
820             }
821             try {
822                 fullCacheCountLimit = databaseConfig.getInt(CacheConstants.FULL_CACHE_COUNT_LIMIT);
823             } catch (Exception JavaDoc e) { }
824             try {
825                 initCachesResultSetType = databaseConfig.getString(CommonConstants.INIT_CACHES_RESULT_SET_TYPE);
826             } catch (Exception JavaDoc e) { }
827             
828             try {
829                 initCachesResultSetConcurrency = databaseConfig.getString(CommonConstants.INIT_CACHES_RESULT_SET_CONCURRENCY);
830             } catch (Exception JavaDoc e) { }
831             try {
832                 sqlBatch = databaseConfig.getBoolean(CommonConstants.SQL_BATCH);
833             } catch (Exception JavaDoc e) { }
834             try {
835                 caseInsensitiveDatabase = databaseConfig.getBoolean(CommonConstants.CASE_INSENSITIVE_DATABASE);
836             } catch (Exception JavaDoc e) {}
837
838             try {
839                 queryTimeLimit = new Integer JavaDoc (databaseConfig.getInt(CommonConstants.QUERY_TIME_LIMIT));
840             } catch (Exception JavaDoc e) {
841                 queryTimeLimit = null;
842             }
843             // -XA
844
try {
845                 xaDefaultTimeout = databaseConfig.getInt(CommonConstants.XA_DEFAULT_TIMEOUT);
846             } catch (Exception JavaDoc e) { }
847             try {
848                 xaTransactonManagerLookupName = databaseConfig.getString(CommonConstants.XA_TM_LOOKUP_NAME);
849             } catch (Exception JavaDoc e) { }
850             try {
851                 xaUsageCase = databaseConfig.getInt(CommonConstants.XA_USAGE_CASE);
852             } catch (Exception JavaDoc e) { }
853             try {
854                 xaWrappedTransImplFactory = databaseConfig.getString(CommonConstants.XA_WRAPPED_TRANS_IMPL_FACTORY);
855             } catch (Exception JavaDoc e) { }
856             try {
857                 xaUserTransactonLookupName = databaseConfig.getString(CommonConstants.XA_USER_TRANSACTION_LOOKUP_NAME);
858             } catch (Exception JavaDoc e) { }
859             try {
860                 xaJtaSupport = databaseConfig.getString(CommonConstants.XA_JTA_SUPPORT);
861             } catch (Exception JavaDoc e) { }
862             // -XA
863

864         }
865         try {
866             databaseConfig = (Config) DODS.getDatabaseManager().getConfig().getSection("defaults.cache");
867         } catch (Exception JavaDoc ex) {}
868         if (databaseConfig != null) {
869             try {
870                 reserveFactor = databaseConfig.getDouble(PARAMNAME_RESERVE_FACTOR);
871             } catch (Exception JavaDoc e) {}
872             try {
873                 cachePercentage = databaseConfig.getDouble(PARAMNAME_CACHE_PERCENTAGE);
874             } catch (Exception JavaDoc e) {}
875             try {
876                 maxCacheSize = databaseConfig.getInt(PARAMNAME_MAX_CACHE_SIZE);
877             } catch (Exception JavaDoc e) {}
878             try {
879                 maxSimpleCacheSize = databaseConfig.getInt(PARAMNAME_MAX_SIMPLE_CACHE_SIZE);
880             } catch (Exception JavaDoc e) {}
881             try {
882                 maxComplexCacheSize = databaseConfig.getInt(PARAMNAME_MAX_COMPLEX_CACHE_SIZE);
883             } catch (Exception JavaDoc e) {}
884             try {
885                 maxMultiJoinCacheSize = databaseConfig.getInt(PARAMNAME_MAX_MULTI_JOIN_CACHE_SIZE);
886             } catch (Exception JavaDoc e) {}
887             try {
888                 initialAllCaches = databaseConfig.getBoolean(PARAMNAME_INITIAL_ALL_CACHES);
889             } catch (Exception JavaDoc e) {}
890             try {
891                 initialCacheFetchSize = databaseConfig.getInt(PARAMNAME_INITIAL_CACHE_FETCH_SIZE);
892             } catch (Exception JavaDoc e) {}
893             try {
894                 initialDSCacheSize = databaseConfig.getInt(PARAMNAME_INITIAL_DS_CACHE_SIZE);
895             } catch (Exception JavaDoc e) {}
896             try {
897                 dodsCacheFactory = databaseConfig.getString(PARAMNAME_DODS_CACHE_FACTORY);
898             } catch (Exception JavaDoc e) { }
899         }
900     }
901
902     /**
903      * @return
904      */

905     public String JavaDoc getDBConnectionFactoryName() {
906         return DBConnectionFactoryName;
907     }
908
909     /**
910      * @param string
911      */

912     public void setDBConnectionFactoryName(String JavaDoc string) {
913         DBConnectionFactoryName = string;
914     }
915
916     /**
917      * @return
918      */

919     public int getInitialCacheFetchSize() {
920         return initialCacheFetchSize;
921     }
922
923     /**
924      * @return
925      */

926     public int getInitialDSCacheSize() {
927         return initialDSCacheSize;
928     }
929
930     /**
931      * @param i
932      */

933     public void setInitialCacheFetchSize(int i) {
934         initialCacheFetchSize = i;
935     }
936
937     /**
938      * @param i
939      */

940     public void setInitialDSCacheSize(int i) {
941         initialDSCacheSize = i;
942     }
943
944     /**
945      * @return
946      */

947     public String JavaDoc getQueryCacheImplClass() {
948         return queryCacheImplClass;
949     }
950
951     /**
952      * @param string
953      */

954     public void setQueryCacheImplClass(String JavaDoc string) {
955         queryCacheImplClass = string;
956     }
957
958     /**
959      * @return
960      */

961     public String JavaDoc getInitCachesResultSetConcurrency() {
962         return initCachesResultSetConcurrency;
963     }
964
965     /**
966      * @return
967      */

968     public String JavaDoc getInitCachesResultSetType() {
969         return initCachesResultSetType;
970     }
971
972     /**
973      * @param string
974      */

975     public void setInitCachesResultSetConcurrency(String JavaDoc string) {
976         initCachesResultSetConcurrency = string;
977     }
978
979     /**
980      * @param string
981      */

982     public void setInitCachesResultSetType(String JavaDoc string) {
983         initCachesResultSetType = string;
984     }
985
986     /**
987      * @return
988      */

989     public boolean isSqlBatch() {
990         return sqlBatch;
991     }
992
993     /**
994      * @param b
995      */

996     public void setSqlBatch(boolean b) {
997         sqlBatch = b;
998     }
999
1000    /**
1001     * @return Returns the caseInsensitiveDatabase.
1002     */

1003    public boolean isCaseInsensitiveDatabase() {
1004        return caseInsensitiveDatabase;
1005    }
1006    /**
1007     * @param caseInsensitiveDatabase The caseInsensitiveDatabase to set.
1008     */

1009    public void setCaseInsensitiveDatabase(boolean caseInsensitiveDatabase) {
1010        this.caseInsensitiveDatabase = caseInsensitiveDatabase;
1011    }
1012
1013    
1014    /**
1015     * @return Returns the queryTimeLimit.
1016     */

1017    public Integer JavaDoc getQueryTimeLimit() {
1018        return queryTimeLimit;
1019    }
1020    
1021    /**
1022     * @param queryTimeLimit The queryTimeLimit to set.
1023     */

1024    public void setQueryTimeLimit(Integer JavaDoc queryTimeLimit) {
1025        this.queryTimeLimit = queryTimeLimit;
1026    }
1027    
1028    /**
1029     * @return Returns the xaDefaultTimeout.
1030     */

1031    public int getXaDefaultTimeout() {
1032        return xaDefaultTimeout;
1033    }
1034    
1035    /**
1036     * @param xaDefaultTimeout The xaDefaultTimeout to set.
1037     */

1038    public void setXaDefaultTimeout(int xaDefaultTimeout) {
1039        this.xaDefaultTimeout = xaDefaultTimeout;
1040    }
1041    
1042    /**
1043     * @return Returns the xaTransactonManagerLookupName.
1044     */

1045    public String JavaDoc getXaTransactonManagerLookupName() {
1046        return xaTransactonManagerLookupName;
1047    }
1048    
1049    /**
1050     * @param xaTransactonManagerLookupName The xaTransactonManagerLookupName to set.
1051     */

1052    public void setXaTransactonManagerLookupName(
1053            String JavaDoc xaTransactonManagerLookupName) {
1054        this.xaTransactonManagerLookupName = xaTransactonManagerLookupName;
1055    }
1056    
1057    /**
1058     * @return Returns the xaUsageCase.
1059     */

1060    public int getXaUsageCase() {
1061        return xaUsageCase;
1062    }
1063    
1064    /**
1065     * @param xaUsageCase The xaUsageCase to set.
1066     */

1067    public void setXaUsageCase(int xaUsageCase) {
1068        this.xaUsageCase = xaUsageCase;
1069    }
1070    
1071    /**
1072     * @return Returns the xaWrappedTransImplFactory.
1073     */

1074    public String JavaDoc getXaWrappedTransImplFactory() {
1075        return xaWrappedTransImplFactory;
1076    }
1077    
1078    /**
1079     * @param xaWrappedTransImplFactory The xaWrappedTransImplFactory to set.
1080     */

1081    public void setXaWrappedTransImplFactory(String JavaDoc xaWrappedTransImplFactory) {
1082        this.xaWrappedTransImplFactory = xaWrappedTransImplFactory;
1083    }
1084    
1085    /**
1086     * @return Returns the xaUserTransactonLookupName.
1087     */

1088    public String JavaDoc getXaUserTransactonLookupName() {
1089        return xaUserTransactonLookupName;
1090    }
1091    
1092    /**
1093     * @param xaUserTransactonLookupName The xaUserTransactonLookupName to set.
1094     */

1095    public void setXaUserTransactonLookupName(String JavaDoc xaUserTransactonLookupName) {
1096        this.xaUserTransactonLookupName = xaUserTransactonLookupName;
1097    }
1098    
1099    /**
1100     * @return Returns the xaJtaSupport.
1101     */

1102    public String JavaDoc getXaJtaSupport() {
1103        return xaJtaSupport;
1104    }
1105    
1106    /**
1107     * @param xaJtaSupport The xaJtaSupport to set.
1108     */

1109    public void setXaJtaSupport(String JavaDoc xaJtaSupport) {
1110        this.xaJtaSupport = xaJtaSupport;
1111    }
1112    
1113    /**
1114     * @return Returns the dods_cache_factory.
1115     */

1116    public String JavaDoc getDodsCacheFactory() {
1117        return this.dodsCacheFactory;
1118    }
1119    /**
1120     * @param dods_cache_factory The dods_cache_factory to set.
1121     */

1122    public void setDodsCacheFactory(String JavaDoc dodsCacheFactory) {
1123        this.dodsCacheFactory = dodsCacheFactory;
1124    }
1125}
1126
Popular Tags