You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Mathius Allo <mg...@yahoo.com> on 2007/06/20 09:43:28 UTC

Error was: java.sql.SQLException: Duplicate column name

  Hi All,
   
  I have commented out the following line under localmysql datasource but everytime I run my application, it seems it always try to re-create those existing tables. How to avoid this scenario?
   
  <!--
  <read-data reader-name="seed"/>
  <read-data reader-name="demo"/>
  <read-data reader-name="ext"/>
  -->
   
  17391[       DatabaseUtil.java:821:INFO ] - non-nullable column      [true]*
17391[       DatabaseUtil.java:858:INFO ] Getting Table Info From Database
90110[       DatabaseUtil.java:993:INFO ] Getting Column Info From Database
97156[       DatabaseUtil.java:1145:ERROR] Error getting column meta data for Error was:java.sql.SQLException: Can't create/write to file 'C:\WINDOWS\TEMP\#sql_a18_0.MYI' (Errcode: 13). Not checking columns.
97156[       DatabaseUtil.java:335:WARN ] Field [acctgTransId] of entity [AcctgTrans] is missing its corresponding column [ACCTG_TRANS_ID] (and it is a PRIMARY KEY FIELD)
97203[       DatabaseUtil.java:1708:INFO ] [addColumn] sql=ALTER TABLE ACCTG_TRANS ADD ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
97235[       DatabaseUtil.java:1736:INFO ] [addColumn] sql failed, trying sql2=ALTER TABLE ACCTG_TRANS ADD COLUMN ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
98625[       DatabaseUtil.java:344:ERROR] Could not add column [ACCTG_TRANS_ID] to table [ACCTG_TRANS]: SQL Exception while executing the following:
ALTER TABLE ACCTG_TRANS ADD ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
Error was: java.sql.SQLException: Duplicate column name 'ACCTG_TRANS_ID'
  

       
---------------------------------
You snooze, you lose. Get messages ASAP with AutoCheck
 in the all-new Yahoo! Mail Beta. 

Re: Error was: java.sql.SQLException: Duplicate column name

Posted by Mathius Allo <mg...@yahoo.com>.
Hi David,
   
  Thanks for your feedback. I don't see those sql error anymore.
   
  Regards,
  Mathius

  
David E Jones <jo...@hotwaxmedia.com> wrote:
  
Those are just the data loading entries, nothing to do with the database meta data.

To tell it not to add missing tables, etc just set the add-missing attribute to false.

-David


Mathius Allo wrote:
> Hi All,
> 
> I have commented out the following line under localmysql datasource but everytime I run my application, it seems it always try to re-create those existing tables. How to avoid this scenario?
> 
> >   
>   
>   
>   -->
> 
> 17391[ DatabaseUtil.java:821:INFO ] - non-nullable column [true]*
> 17391[ DatabaseUtil.java:858:INFO ] Getting Table Info From Database
> 90110[ DatabaseUtil.java:993:INFO ] Getting Column Info From Database
> 97156[ DatabaseUtil.java:1145:ERROR] Error getting column meta data for Error was:java.sql.SQLException: Can't create/write to file 'C:\WINDOWS\TEMP\#sql_a18_0.MYI' (Errcode: 13). Not checking columns.
> 97156[ DatabaseUtil.java:335:WARN ] Field [acctgTransId] of entity [AcctgTrans] is missing its corresponding column [ACCTG_TRANS_ID] (and it is a PRIMARY KEY FIELD)
> 97203[ DatabaseUtil.java:1708:INFO ] [addColumn] sql=ALTER TABLE ACCTG_TRANS ADD ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
> 97235[ DatabaseUtil.java:1736:INFO ] [addColumn] sql failed, trying sql2=ALTER TABLE ACCTG_TRANS ADD COLUMN ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
> 98625[ DatabaseUtil.java:344:ERROR] Could not add column [ACCTG_TRANS_ID] to table [ACCTG_TRANS]: SQL Exception while executing the following:
> ALTER TABLE ACCTG_TRANS ADD ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
> Error was: java.sql.SQLException: Duplicate column name 'ACCTG_TRANS_ID'
> 
> 
> 
> ---------------------------------
> You snooze, you lose. Get messages ASAP with AutoCheck
> in the all-new Yahoo! Mail Beta. 


       
---------------------------------
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us.

Re: Error was: java.sql.SQLException: Duplicate column name

Posted by David E Jones <jo...@hotwaxmedia.com>.
Those are just the data loading entries, nothing to do with the database meta data.

To tell it not to add missing tables, etc just set the add-missing attribute to false.

-David


Mathius Allo wrote:
>   Hi All,
>    
>   I have commented out the following line under localmysql datasource but everytime I run my application, it seems it always try to re-create those existing tables. How to avoid this scenario?
>    
>   <!--
>   <read-data reader-name="seed"/>
>   <read-data reader-name="demo"/>
>   <read-data reader-name="ext"/>
>   -->
>    
>   17391[       DatabaseUtil.java:821:INFO ] - non-nullable column      [true]*
> 17391[       DatabaseUtil.java:858:INFO ] Getting Table Info From Database
> 90110[       DatabaseUtil.java:993:INFO ] Getting Column Info From Database
> 97156[       DatabaseUtil.java:1145:ERROR] Error getting column meta data for Error was:java.sql.SQLException: Can't create/write to file 'C:\WINDOWS\TEMP\#sql_a18_0.MYI' (Errcode: 13). Not checking columns.
> 97156[       DatabaseUtil.java:335:WARN ] Field [acctgTransId] of entity [AcctgTrans] is missing its corresponding column [ACCTG_TRANS_ID] (and it is a PRIMARY KEY FIELD)
> 97203[       DatabaseUtil.java:1708:INFO ] [addColumn] sql=ALTER TABLE ACCTG_TRANS ADD ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
> 97235[       DatabaseUtil.java:1736:INFO ] [addColumn] sql failed, trying sql2=ALTER TABLE ACCTG_TRANS ADD COLUMN ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
> 98625[       DatabaseUtil.java:344:ERROR] Could not add column [ACCTG_TRANS_ID] to table [ACCTG_TRANS]: SQL Exception while executing the following:
> ALTER TABLE ACCTG_TRANS ADD ACCTG_TRANS_ID VARCHAR(20) CHARACTER SET latin1 COLLATE latin1_general_cs
> Error was: java.sql.SQLException: Duplicate column name 'ACCTG_TRANS_ID'
>   
> 
>        
> ---------------------------------
> You snooze, you lose. Get messages ASAP with AutoCheck
>  in the all-new Yahoo! Mail Beta.