You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Charl Gerber (JIRA)" <ji...@apache.org> on 2007/08/08 10:54:59 UTC

[jira] Created: (CONFIGURATION-289) Cannot set lineDelimiter for DatabaseConfiguration

Cannot set lineDelimiter for DatabaseConfiguration
--------------------------------------------------

                 Key: CONFIGURATION-289
                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-289
             Project: Commons Configuration
          Issue Type: Improvement
            Reporter: Charl Gerber
            Priority: Minor


I am using a DatabaseConfiguration to store templates of e-mail messages. The values are mysql TEXT types and include comma's (','). The DatabaseConfiguration however is read and initialized when I construct it and then uses the default ',' line delimiter to read the templates from the database. All of the templates do have comma's in them, meaning that I cannot retrieve the templates as a String and have to build a mechanism to construct the proper string from the String[] I can get.

It would be very helpful if the DatabaseConfiguration would allow you to specify a delimiter before it reads the values from the tables or even better, provide an option to not use delimiters at all and just read the whole field as one String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-289) Cannot set lineDelimiter for DatabaseConfiguration

Posted by "Charl Gerber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520144 ] 

Charl Gerber commented on CONFIGURATION-289:
--------------------------------------------

I'll try that, thanks. I tried to something like that effect without success. The dbCfg reads the DB values the moment you create it and it seemed as it parsed with delimiters at that stage already before I could set the parsing off. I might be wrong... will double check. I probably AM wrong.

> Cannot set lineDelimiter for DatabaseConfiguration
> --------------------------------------------------
>
>                 Key: CONFIGURATION-289
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-289
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Charl Gerber
>            Priority: Minor
>
> I am using a DatabaseConfiguration to store templates of e-mail messages. The values are mysql TEXT types and include comma's (','). The DatabaseConfiguration however is read and initialized when I construct it and then uses the default ',' line delimiter to read the templates from the database. All of the templates do have comma's in them, meaning that I cannot retrieve the templates as a String and have to build a mechanism to construct the proper string from the String[] I can get.
> It would be very helpful if the DatabaseConfiguration would allow you to specify a delimiter before it reads the values from the tables or even better, provide an option to not use delimiters at all and just read the whole field as one String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CONFIGURATION-289) Cannot set lineDelimiter for DatabaseConfiguration

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger resolved CONFIGURATION-289.
----------------------------------------

       Resolution: Invalid
    Fix Version/s: 1.5

> Cannot set lineDelimiter for DatabaseConfiguration
> --------------------------------------------------
>
>                 Key: CONFIGURATION-289
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-289
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Charl Gerber
>            Priority: Minor
>             Fix For: 1.5
>
>
> I am using a DatabaseConfiguration to store templates of e-mail messages. The values are mysql TEXT types and include comma's (','). The DatabaseConfiguration however is read and initialized when I construct it and then uses the default ',' line delimiter to read the templates from the database. All of the templates do have comma's in them, meaning that I cannot retrieve the templates as a String and have to build a mechanism to construct the proper string from the String[] I can get.
> It would be very helpful if the DatabaseConfiguration would allow you to specify a delimiter before it reads the values from the tables or even better, provide an option to not use delimiters at all and just read the whole field as one String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-289) Cannot set lineDelimiter for DatabaseConfiguration

Posted by "Charl Gerber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518664 ] 

Charl Gerber commented on CONFIGURATION-289:
--------------------------------------------

I'm using Configuration 1.4.

I am using a BaseConfiguration to cache the database for read operations:

BaseConfiguration baseConfiguration = new BaseConfiguration();
        
DatabaseConfiguration dbCfg = new DatabaseConfiguration(DATASOURCE,
                              tableName, keyName, valueName);
ConfigurationUtils.copy(dbCfg, baseConfiguration);

At this stage the values are delimitered in the baseConfiguration, which I do not want.



> Cannot set lineDelimiter for DatabaseConfiguration
> --------------------------------------------------
>
>                 Key: CONFIGURATION-289
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-289
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Charl Gerber
>            Priority: Minor
>
> I am using a DatabaseConfiguration to store templates of e-mail messages. The values are mysql TEXT types and include comma's (','). The DatabaseConfiguration however is read and initialized when I construct it and then uses the default ',' line delimiter to read the templates from the database. All of the templates do have comma's in them, meaning that I cannot retrieve the templates as a String and have to build a mechanism to construct the proper string from the String[] I can get.
> It would be very helpful if the DatabaseConfiguration would allow you to specify a delimiter before it reads the values from the tables or even better, provide an option to not use delimiters at all and just read the whole field as one String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-289) Cannot set lineDelimiter for DatabaseConfiguration

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518700 ] 

Oliver Heger commented on CONFIGURATION-289:
--------------------------------------------

Well, DatabaseConfiguration does allow you to disable the parsing of list delimiters. Try the following:

BaseConfiguration baseConfiguration = new BaseConfiguration();
DatabaseConfiguration dbCfg = new DatabaseConfiguration(DATASOURCE,
                              tableName, keyName, valueName);

baseConfiguration.setDelimiterParsingDisabled(true);
dbCfg.setDelimiterParsingDisabled(true);

ConfigurationUtils.copy(dbCfg, baseConfiguration); 


> Cannot set lineDelimiter for DatabaseConfiguration
> --------------------------------------------------
>
>                 Key: CONFIGURATION-289
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-289
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Charl Gerber
>            Priority: Minor
>
> I am using a DatabaseConfiguration to store templates of e-mail messages. The values are mysql TEXT types and include comma's (','). The DatabaseConfiguration however is read and initialized when I construct it and then uses the default ',' line delimiter to read the templates from the database. All of the templates do have comma's in them, meaning that I cannot retrieve the templates as a String and have to build a mechanism to construct the proper string from the String[] I can get.
> It would be very helpful if the DatabaseConfiguration would allow you to specify a delimiter before it reads the values from the tables or even better, provide an option to not use delimiters at all and just read the whole field as one String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-289) Cannot set lineDelimiter for DatabaseConfiguration

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518534 ] 

Oliver Heger commented on CONFIGURATION-289:
--------------------------------------------

Which version of Commons Configuration do you use?

The problem should be fixed in version 1.4. See CONFIGURATION-255.

> Cannot set lineDelimiter for DatabaseConfiguration
> --------------------------------------------------
>
>                 Key: CONFIGURATION-289
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-289
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Charl Gerber
>            Priority: Minor
>
> I am using a DatabaseConfiguration to store templates of e-mail messages. The values are mysql TEXT types and include comma's (','). The DatabaseConfiguration however is read and initialized when I construct it and then uses the default ',' line delimiter to read the templates from the database. All of the templates do have comma's in them, meaning that I cannot retrieve the templates as a String and have to build a mechanism to construct the proper string from the String[] I can get.
> It would be very helpful if the DatabaseConfiguration would allow you to specify a delimiter before it reads the values from the tables or even better, provide an option to not use delimiters at all and just read the whole field as one String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-289) Cannot set lineDelimiter for DatabaseConfiguration

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520162 ] 

Oliver Heger commented on CONFIGURATION-289:
--------------------------------------------

DatabaseConfiguration does not do any preloading or caching. Each property access causes a Select statement being executed. At this moment, line delimiters are handled. So setting the delimiter parsing disabled-flag will immediately have effect.

> Cannot set lineDelimiter for DatabaseConfiguration
> --------------------------------------------------
>
>                 Key: CONFIGURATION-289
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-289
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Charl Gerber
>            Priority: Minor
>
> I am using a DatabaseConfiguration to store templates of e-mail messages. The values are mysql TEXT types and include comma's (','). The DatabaseConfiguration however is read and initialized when I construct it and then uses the default ',' line delimiter to read the templates from the database. All of the templates do have comma's in them, meaning that I cannot retrieve the templates as a String and have to build a mechanism to construct the proper string from the String[] I can get.
> It would be very helpful if the DatabaseConfiguration would allow you to specify a delimiter before it reads the values from the tables or even better, provide an option to not use delimiters at all and just read the whole field as one String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CONFIGURATION-289) Cannot set lineDelimiter for DatabaseConfiguration

Posted by "Charl Gerber (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-289?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12520475 ] 

Charl Gerber commented on CONFIGURATION-289:
--------------------------------------------

You're right, the code snippet above worked fine. You can close this issue as INVALID.
Thanks for the help.


> Cannot set lineDelimiter for DatabaseConfiguration
> --------------------------------------------------
>
>                 Key: CONFIGURATION-289
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-289
>             Project: Commons Configuration
>          Issue Type: Improvement
>            Reporter: Charl Gerber
>            Priority: Minor
>
> I am using a DatabaseConfiguration to store templates of e-mail messages. The values are mysql TEXT types and include comma's (','). The DatabaseConfiguration however is read and initialized when I construct it and then uses the default ',' line delimiter to read the templates from the database. All of the templates do have comma's in them, meaning that I cannot retrieve the templates as a String and have to build a mechanism to construct the proper string from the String[] I can get.
> It would be very helpful if the DatabaseConfiguration would allow you to specify a delimiter before it reads the values from the tables or even better, provide an option to not use delimiters at all and just read the whole field as one String.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.