You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by BJ Freeman <bj...@free-man.net> on 2008/07/16 21:38:11 UTC

DatabaseUtil Mods

I moved this from user since some thought has to be put in on how to
handle different DB that use different reserved words.

currently it is hard coded for instance to use rename for a column.
However our default DB OTTB uses Alter for a column

my suggestion is use framework\entity\dbparms
folder and put in files that denote each db.
this way the code would be changed only by adding routine to look of the
db equivalent for Rename.

any other Ideas.


Re: DatabaseUtil Mods

Posted by BJ Freeman <bj...@free-man.net>.
there is this jira
http://issues.apache.org/jira/browse/DERBY-1490

BJ Freeman sent the following on 7/16/2008 12:38 PM:
> I moved this from user since some thought has to be put in on how to
> handle different DB that use different reserved words.
> 
> currently it is hard coded for instance to use rename for a column.
> However our default DB OTTB uses Alter for a column
> 
> my suggestion is use framework\entity\dbparms
> folder and put in files that denote each db.
> this way the code would be changed only by adding routine to look of the
> db equivalent for Rename.
> 
> any other Ideas.
> 
> 
> 
> 


Re: DatabaseUtil Mods

Posted by BJ Freeman <bj...@free-man.net>.
further explain from user list

for the derby got this error a lot
    * SQL Exception while executing the following: ALTER TABLE
OFBIZ.WORK_EFFORT_SEARCH_RESULT RENAME NUM_RESULTS TO TMP_NUMRESULTS
Error was: java.sql.SQLException: Syntax error: Encountered "RENAME" at
line 1, column 45.

this will be fixed if we upgrade to version 10.3.1.4



David E Jones sent the following on 7/16/2008 1:24 PM:
> 
> Could you be more specific about the problem? I'm not able to figure
> that our based on the solution you are proposing...
> 
> Which database are you using? What SQL in particular is not supported,
> and what does that SQL need to look like to work?
> 
> -David
> 
> 
> On Jul 16, 2008, at 1:38 PM, BJ Freeman wrote:
> 
>> I moved this from user since some thought has to be put in on how to
>> handle different DB that use different reserved words.
>>
>> currently it is hard coded for instance to use rename for a column.
>> However our default DB OTTB uses Alter for a column
>>
>> my suggestion is use framework\entity\dbparms
>> folder and put in files that denote each db.
>> this way the code would be changed only by adding routine to look of the
>> db equivalent for Rename.
>>
>> any other Ideas.
>>
> 
> 
> 
> 


Re: Derby Alter/nename fix was DatabaseUtil Mods

Posted by BJ Freeman <bj...@free-man.net>.
David:
for those that are doing Clean-all it will no effect them
for those that are doing upgrade testing it does.
Not sure when the next official release is. could not find a release date.

David Jones sent the following on 7/17/2008 3:12 PM:
> Is this bug actually causing a problem for anyone? This seems like a pain and a waste since we'll be pulling out as soon as Derby updates.
> 
> Using Derby in production is probably a bad idea anyway, and that seems the main place where these sorts of alters would be used.
> 
> For your own needs BJ, why not just run some manual SQL and then don't worry about it?
> 
> I could be wrong about others running into the issue though... if anyone is running into this, please comment!
> 
> -David
> 
> 
> On Thu, 17 Jul 2008 14:42:14 -0700, BJ Freeman <bj...@free-man.net> wrote:
>> our current version of derby is the last official release 10.3.1.3
>> This supports the Alter column, instead of the RENAME COLUMN currently
>> in DatabaseUtil
>> this break the modifying of the DB.
>> So I propose using the DAOHELPEr since it is assigned in the
>> entityengine.xml
>>             helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
>> Modify the interface Generic Helper to process Reserved words
>> Add a String ProcessReservedWords(string word){return word;}
>> to the Helper files that use the interface
>> Copy and modify the GenericHelperDAO to GenericHelperDAODerby10_3_1_3
>> fill out
>> String ProcessReservedWords(string word){return word;}
>> to return Alter for Rename otherwise return word.
>> Then wrap all the reserved words in DatabaseUtil or any other java file
>> that has reserved words, with ProcessReservedWords();
>> then change the entityengine.xml for derby to
>> helper-class="org.ofbiz.entity.datasource.GenericHelperDAODerby10_3_1_3"
>>
>> if this meets with the approval i will create a jira and patch.
>>
>> BJ Freeman sent the following on 7/17/2008 6:56 AM:
>>> sigh
>>> version 10.3.1.4
>>> is not an official release
>>>
>>> so do we wait for the release
>>> or fix code to work with ALTER
>>> version 10.3.1.3
>>>
>>>
>>>
>>>
>>> BJ Freeman sent the following on 7/16/2008 1:33 PM:
>>>> David it is the derby (ottb db)
>>>> from the jira I found for DB is seems they fixed it in
>>>> http://issues.apache.org/jira/browse/DERBY-1490
>>>> version 10.3.1.4
>>>> we have 10.3.1.3
>>>> so upgrading the drivers should solve the problem
>>>>
>>>> David E Jones sent the following on 7/16/2008 1:24 PM:
>>>>> Could you be more specific about the problem? I'm not able to figure
>>>>> that our based on the solution you are proposing...
>>>>>
>>>>> Which database are you using? What SQL in particular is not supported,
>>>>> and what does that SQL need to look like to work?
>>>>>
>>>>> -David
>>>>>
>>>>>
>>>>> On Jul 16, 2008, at 1:38 PM, BJ Freeman wrote:
>>>>>
>>>>>> I moved this from user since some thought has to be put in on how to
>>>>>> handle different DB that use different reserved words.
>>>>>>
>>>>>> currently it is hard coded for instance to use rename for a column.
>>>>>> However our default DB OTTB uses Alter for a column
>>>>>>
>>>>>> my suggestion is use framework\entity\dbparms
>>>>>> folder and put in files that denote each db.
>>>>>> this way the code would be changed only by adding routine to look of
>> the
>>>>>> db equivalent for Rename.
>>>>>>
>>>>>> any other Ideas.
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>>
> 
> 
> 
> 


Re: Derby Alter/nename fix was DatabaseUtil Mods

Posted by David Jones <jo...@hotwaxmedia.com>.
Is this bug actually causing a problem for anyone? This seems like a pain and a waste since we'll be pulling out as soon as Derby updates.

Using Derby in production is probably a bad idea anyway, and that seems the main place where these sorts of alters would be used.

For your own needs BJ, why not just run some manual SQL and then don't worry about it?

I could be wrong about others running into the issue though... if anyone is running into this, please comment!

-David


On Thu, 17 Jul 2008 14:42:14 -0700, BJ Freeman <bj...@free-man.net> wrote:
> our current version of derby is the last official release 10.3.1.3
> This supports the Alter column, instead of the RENAME COLUMN currently
> in DatabaseUtil
> this break the modifying of the DB.
> So I propose using the DAOHELPEr since it is assigned in the
> entityengine.xml
>             helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
> Modify the interface Generic Helper to process Reserved words
> Add a String ProcessReservedWords(string word){return word;}
> to the Helper files that use the interface
> Copy and modify the GenericHelperDAO to GenericHelperDAODerby10_3_1_3
> fill out
> String ProcessReservedWords(string word){return word;}
> to return Alter for Rename otherwise return word.
> Then wrap all the reserved words in DatabaseUtil or any other java file
> that has reserved words, with ProcessReservedWords();
> then change the entityengine.xml for derby to
> helper-class="org.ofbiz.entity.datasource.GenericHelperDAODerby10_3_1_3"
> 
> if this meets with the approval i will create a jira and patch.
> 
> BJ Freeman sent the following on 7/17/2008 6:56 AM:
>> sigh
>> version 10.3.1.4
>> is not an official release
>>
>> so do we wait for the release
>> or fix code to work with ALTER
>> version 10.3.1.3
>>
>>
>>
>>
>> BJ Freeman sent the following on 7/16/2008 1:33 PM:
>>> David it is the derby (ottb db)
>>> from the jira I found for DB is seems they fixed it in
>>> http://issues.apache.org/jira/browse/DERBY-1490
>>> version 10.3.1.4
>>> we have 10.3.1.3
>>> so upgrading the drivers should solve the problem
>>>
>>> David E Jones sent the following on 7/16/2008 1:24 PM:
>>>> Could you be more specific about the problem? I'm not able to figure
>>>> that our based on the solution you are proposing...
>>>>
>>>> Which database are you using? What SQL in particular is not supported,
>>>> and what does that SQL need to look like to work?
>>>>
>>>> -David
>>>>
>>>>
>>>> On Jul 16, 2008, at 1:38 PM, BJ Freeman wrote:
>>>>
>>>>> I moved this from user since some thought has to be put in on how to
>>>>> handle different DB that use different reserved words.
>>>>>
>>>>> currently it is hard coded for instance to use rename for a column.
>>>>> However our default DB OTTB uses Alter for a column
>>>>>
>>>>> my suggestion is use framework\entity\dbparms
>>>>> folder and put in files that denote each db.
>>>>> this way the code would be changed only by adding routine to look of
> the
>>>>> db equivalent for Rename.
>>>>>
>>>>> any other Ideas.
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>>


Derby Alter/nename fix was DatabaseUtil Mods

Posted by BJ Freeman <bj...@free-man.net>.
our current version of derby is the last official release 10.3.1.3
This supports the Alter column, instead of the RENAME COLUMN currently
in DatabaseUtil
this break the modifying of the DB.
So I propose using the DAOHELPEr since it is assigned in the
entityengine.xml
            helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
Modify the interface Generic Helper to process Reserved words
Add a String ProcessReservedWords(string word){return word;}
to the Helper files that use the interface
Copy and modify the GenericHelperDAO to GenericHelperDAODerby10_3_1_3
fill out
String ProcessReservedWords(string word){return word;}
to return Alter for Rename otherwise return word.
Then wrap all the reserved words in DatabaseUtil or any other java file
that has reserved words, with ProcessReservedWords();
then change the entityengine.xml for derby to
helper-class="org.ofbiz.entity.datasource.GenericHelperDAODerby10_3_1_3"

if this meets with the approval i will create a jira and patch.

BJ Freeman sent the following on 7/17/2008 6:56 AM:
> sigh
> version 10.3.1.4
> is not an official release
> 
> so do we wait for the release
> or fix code to work with ALTER
> version 10.3.1.3
> 
> 
> 
> 
> BJ Freeman sent the following on 7/16/2008 1:33 PM:
>> David it is the derby (ottb db)
>> from the jira I found for DB is seems they fixed it in
>> http://issues.apache.org/jira/browse/DERBY-1490
>> version 10.3.1.4
>> we have 10.3.1.3
>> so upgrading the drivers should solve the problem
>>
>> David E Jones sent the following on 7/16/2008 1:24 PM:
>>> Could you be more specific about the problem? I'm not able to figure
>>> that our based on the solution you are proposing...
>>>
>>> Which database are you using? What SQL in particular is not supported,
>>> and what does that SQL need to look like to work?
>>>
>>> -David
>>>
>>>
>>> On Jul 16, 2008, at 1:38 PM, BJ Freeman wrote:
>>>
>>>> I moved this from user since some thought has to be put in on how to
>>>> handle different DB that use different reserved words.
>>>>
>>>> currently it is hard coded for instance to use rename for a column.
>>>> However our default DB OTTB uses Alter for a column
>>>>
>>>> my suggestion is use framework\entity\dbparms
>>>> folder and put in files that denote each db.
>>>> this way the code would be changed only by adding routine to look of the
>>>> db equivalent for Rename.
>>>>
>>>> any other Ideas.
>>>>
>>>
>>>
>>
>>
>>
> 
> 
> 
> 


Re: DatabaseUtil Mods

Posted by BJ Freeman <bj...@free-man.net>.
sigh
version 10.3.1.4
is not an official release

so do we wait for the release
or fix code to work with ALTER
version 10.3.1.3




BJ Freeman sent the following on 7/16/2008 1:33 PM:
> David it is the derby (ottb db)
> from the jira I found for DB is seems they fixed it in
> http://issues.apache.org/jira/browse/DERBY-1490
> version 10.3.1.4
> we have 10.3.1.3
> so upgrading the drivers should solve the problem
> 
> David E Jones sent the following on 7/16/2008 1:24 PM:
>> Could you be more specific about the problem? I'm not able to figure
>> that our based on the solution you are proposing...
>>
>> Which database are you using? What SQL in particular is not supported,
>> and what does that SQL need to look like to work?
>>
>> -David
>>
>>
>> On Jul 16, 2008, at 1:38 PM, BJ Freeman wrote:
>>
>>> I moved this from user since some thought has to be put in on how to
>>> handle different DB that use different reserved words.
>>>
>>> currently it is hard coded for instance to use rename for a column.
>>> However our default DB OTTB uses Alter for a column
>>>
>>> my suggestion is use framework\entity\dbparms
>>> folder and put in files that denote each db.
>>> this way the code would be changed only by adding routine to look of the
>>> db equivalent for Rename.
>>>
>>> any other Ideas.
>>>
>>
>>
>>
> 
> 
> 
> 


Re: DatabaseUtil Mods

Posted by BJ Freeman <bj...@free-man.net>.
David it is the derby (ottb db)
from the jira I found for DB is seems they fixed it in
http://issues.apache.org/jira/browse/DERBY-1490
version 10.3.1.4
we have 10.3.1.3
so upgrading the drivers should solve the problem

David E Jones sent the following on 7/16/2008 1:24 PM:
> 
> Could you be more specific about the problem? I'm not able to figure
> that our based on the solution you are proposing...
> 
> Which database are you using? What SQL in particular is not supported,
> and what does that SQL need to look like to work?
> 
> -David
> 
> 
> On Jul 16, 2008, at 1:38 PM, BJ Freeman wrote:
> 
>> I moved this from user since some thought has to be put in on how to
>> handle different DB that use different reserved words.
>>
>> currently it is hard coded for instance to use rename for a column.
>> However our default DB OTTB uses Alter for a column
>>
>> my suggestion is use framework\entity\dbparms
>> folder and put in files that denote each db.
>> this way the code would be changed only by adding routine to look of the
>> db equivalent for Rename.
>>
>> any other Ideas.
>>
> 
> 
> 
> 


Re: DatabaseUtil Mods

Posted by David E Jones <jo...@hotwaxmedia.com>.
Could you be more specific about the problem? I'm not able to figure  
that our based on the solution you are proposing...

Which database are you using? What SQL in particular is not supported,  
and what does that SQL need to look like to work?

-David


On Jul 16, 2008, at 1:38 PM, BJ Freeman wrote:

> I moved this from user since some thought has to be put in on how to
> handle different DB that use different reserved words.
>
> currently it is hard coded for instance to use rename for a column.
> However our default DB OTTB uses Alter for a column
>
> my suggestion is use framework\entity\dbparms
> folder and put in files that denote each db.
> this way the code would be changed only by adding routine to look of  
> the
> db equivalent for Rename.
>
> any other Ideas.
>