geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Woods <dwo...@apache.org>
Subject Re: JPA issue
Date Wed, 03 Sep 2008 19:09:29 GMT
I just upgraded our 2.1 branch and trunk to use OpenJPA 1.2.0 instead of 
the older 1.0.2 level.  Can you grab a 2.1 snapshot build tomorrow 
(20080904 or later) and see if that solves your problem?

http://people.apache.org/builds/geronimo/server/binaries/2.1/


-Donald


ericp56 wrote:
> Hello,
> 
> I have a large table with a varchar(16) PK field.  Using Geronimo JPA, the
> query being generated by JPA is something like: 
> 
> declare @P0  nvarchar(4000)
> select @P0 = '1234567890'
> SELECT t0.field1 /*THE PK FIELD which is varchar(16)*/, 
> t0.field2 
> FROM dbo.history t0  WHERE t0.field1 = @P0
> 
> Instead of using the index (seek) , the conversion of varchar(16) to
> nvarchar(4000) causes a full index scan, which is painfully slow (2 seconds,
> should be in milliseconds).
> 
> I tried using the @Column annotation, but that didn't change anything - @P0
> is still nvarchar(4000)
> I tried using a named query, but it only allows basic SQL.
> I tried a native query, but the casting of the result  fails.
> 
> Any suggestions?

Mime
View raw message