openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boblitz John <John.Bobl...@BERTSCHI.com>
Subject AW: Problems with SQLServer VARCHAR(MAX)
Date Mon, 02 Apr 2012 07:41:56 GMT
 

> -----Ursprüngliche Nachricht-----
> Von: bengt.rodehav@gmail.com [mailto:bengt.rodehav@gmail.com] 
> Im Auftrag von Bengt Rodehav
> Gesendet: Montag, 2. April 2012 08:59
> An: users@openjpa.apache.org
> Betreff: Re: Problems with SQLServer VARCHAR(MAX)
> 
> Has no one else encountered this? Does someone has any ideas 
> of how to get rid of this?
> 
> /Bengt
> 
> 2012/3/29 Bengt Rodehav <bengt@rodehav.com>
> 
> > I'm using OpenJPA 2.1.1 with Microsoft SQLServer 2005.
> > In one of my entities I have a field that can potentially be quite 
> > large (it represents an incoming XML message). I therefore 
> store it in 
> > a column defined as "VARCHAR(MAX)". This possibility was 
> introduced in 
> > SQLServer
> > 2005 and allows storing strings up to 2GB in size.
> >
> > I annotate my field as follows:
> >
> > *...*
> > *  @Column(columnDefinition = "VARCHAR(MAX)")*
> > *  private String originalEntry;*
> > *...*
> >
> > The column is created with the correct type by OpenJPA. 
> However, I get 
> > the following warning in my logs:
> >
> > *18078  lafaPU  WARN   [Camel (LAFA) thread #1 - 
> file://~dp0/../../..*
> > */common/data/interfaces/sample/lafa] openjpa.jdbc.Schema - 
> Existing 
> > column "originalEntry" on table "dbo.LafaEntry" is 
> incompatible with 
> > the same column in thegiven schema definition.* *Existing column:* 
> > *Full Name: LafaEntry.originalEntry*
> > *Type: longvarchar*
> > *Size: 2147483647*
> > *Default: null*
> > *Not Null: false*
> > *Given column:*
> > *Full Name: LafaEntry.originalEntry*
> > *Type: varchar*
> > *Size: 255*
> > *Default: null*
> > *Not Null: false*
> >
> > Does anyone know why this is happening and how I can get rid of the 
> > warnings? Is SQLServer 2005 supported by OpenJPA?
> >
> > BTW, the warnings don't seem to be saved in my log files - 
> they only 
> > appear on stdout. Doesn't seem right to me.
> >
> > /Bengt
> >
> >
> >
> 

No idea if this will work, but did you try:

@Column(columnDefinition = "VARCHAR(2147483647)")

 

John

---- 

Who is General Failure, and why is he reading my hard disk?



Mime
View raw message