You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Jo...@bgs-ag.de on 2008/06/11 15:29:37 UTC
Error with openjpa in geronimo under PostgreSQL
Hi All,
I'm quite sure that I found a bug in Geronimo, or as I assumed openjpa.
Therefore I created an JIRA-Issue under
https://issues.apache.org/jira/browse/OPENJPA-627.
But nothing happens. No Votes, no Watchers....
I retested functionality using openejb embedded in Eclipse with openjpa
Version 1.1.0 but I still get the same error:
I receive Errors when I try to persist Data:
public class PasswortregelPAO implements Serializable {
....
@Column(name="passwort_aufbau")
private String passwortAufbau;
....
...
entityManager.persist(pao);
...
on DB-Fields with Definitions >= VARCHAR(170)
ALTER TABLE vesuv.passwortregel DROP COLUMN passwort_aufbau;
ALTER TABLE vesuv.passwortregel ADD COLUMN paswort_aufbau varchar(170);
ALTER TABLE vesuv.passwortregel ALTER COLUMN passwort_aufbau SET STORAGE
EXTEND;
LOG:
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: FEHLER: Wert
zu lang fr Typ character varying(120) {prepstmnt 32613590 INSERT INTO
vesuv.protokoll_info (id, attribut, entitaet_id, entitaetstyp, wert_alt,
wert_neu, protokoll_eintrag_fk) VALUES (?, ?, ?, ?, ?, ?, ?)
[params=(long) 239, (String) passwort_aufbau, (long) 24, (String)
PASSWORTREGEL, (String) , (String)
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...,
(long) 128]} [code=0, state=22001]
With any size bigger than 170, I got the same error "FEHLER: Wert zu lang
fr Typ character varying(120) ".
VARCHAR-Values up to 160 work without any problem.
In addition I have to say, reading of VARCHAR-Data > 170 Char. works
without problem.
=> I tried to change the database-Definition from VARCHAR(170) to TEXT and
to define the PAO @Column(length=200 ...) , but nothing helped.
WHAT TO DO NOW ?
cu Josef
BGS Beratungsgesellschaft
Software Systemplanung AG Niederlassung Rhein/Main
Robert-Koch-Stra�e 41
55129 Mainz
Fon: +49 (0) 6131 / 914-0
Fax: +49 (0) 6131 / 914-400
www.bgs-ag.de Gesch�ftssitz Mainz
Registergericht
Amtsgericht Mainz
HRB 62 50
Aufsichtsratsvorsitzender
Dr. Wolfgang Trommer
Vorstand
Hanspeter Gau
Hermann Kiefer
Nils Manegold
Heinz-J�rg Zimmermann
Antwort: Re: Error with openjpa in geronimo under PostgreSQL
Posted by Jo...@bgs-ag.de.
Hi Rick,
yes I would translate the error with the same words "Value too long for
type character varying(120)".
The missing S is a CopyPaste-Error, sorry for that. I changed datatype up
to varchar(200) and I got always the same error. Using the database-Tool
pgAdmin III of PostgreSQL I can type in data up to the defined max-value
(here: 200). And I can read the data with my application running under
Geronimo 2.1.1 and OpenJPA.
It is a problem of storage under the described conditions. Insert and
Update work only up to max. 120 characters.
David
Rick McGuire <ri...@gmail.com>
12.06.2008 17:10
Bitte antworten an
user@geronimo.apache.org
An
user@geronimo.apache.org
Kopie
Thema
Re: Error with openjpa in geronimo under PostgreSQL
Josef.Eisele@bgs-ag.de wrote:
>
> Hi All,
>
> I'm quite sure that I found a bug in Geronimo, or as I assumed
> openjpa. Therefore I created an JIRA-Issue under
> https://issues.apache.org/jira/browse/OPENJPA-627.
> <https://issues.apache.org/jira/browse/OPENJPA-627>
> But nothing happens. No Votes, no Watchers....
>
> I retested functionality using openejb embedded in Eclipse with
> openjpa Version 1.1.0 but I still get the same error:
>
> I receive Errors when I try to persist Data:
>
> public class PasswortregelPAO implements Serializable {
> ....
> @Column(name="passwort_aufbau")
> private String passwortAufbau;
> ....
> ...
> entityManager.persist(pao);
> ...
>
> on DB-Fields with Definitions >= VARCHAR(170)
>
> ALTER TABLE vesuv.passwortregel DROP COLUMN passwort_aufbau;
> ALTER TABLE vesuv.passwortregel ADD COLUMN paswort_aufbau varchar(170);
> ALTER TABLE vesuv.passwortregel ALTER COLUMN passwort_aufbau SET
> STORAGE EXTEND;
>
>
> LOG:
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: FEHLER:
> Wert zu lang fr Typ character varying(120) {prepstmnt 32613590 INSERT
> INTO vesuv.protokoll_info (id, attribut, entitaet_id, entitaetstyp,
> wert_alt, wert_neu, protokoll_eintrag_fk) VALUES (?, ?, ?, ?, ?, ?, ?)
> [params=(long) 239, (String) passwort_aufbau, (long) 24, (String)
> PASSWORTREGEL, (String) , (String)
> dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...,
> (long) 128]} [code=0, state=22001]
>
> With any size bigger than 170, I got the same error "FEHLER: Wert zu
> lang fr Typ character varying(120) ".
My German is a little rusty, but I believe the error message is saying
"Value too long for type character varying(120)", correct?
Did you copy-and-paste the ALTER TABLE statements above directly into
your email? There appears to be a missing "s" in the name in the "ADD
COLUMN" statement, which might explain why the type is showing up as
character varying(120) in the error message. Though why it would still
work with values up to 160 is a mystery.
If that's just a typo, then it might be a character encoding issue. I'm
not sure how PostgreSQL stores the strings, but if it's using something
like UTF-8, then a 161 character string might require more than 170
characters to store in the column. Have you tried defining the column
size greater than 170?
Rick
>
> VARCHAR-Values up to 160 work without any problem.
>
> In addition I have to say, reading of VARCHAR-Data > 170 Char. works
> without problem.
>
>
> => I tried to change the database-Definition from VARCHAR(170) to TEXT
> and to define the PAO @Column(length=200 ...) , but nothing helped.
>
>
> WHAT TO DO NOW ?
>
> cu Josef
> ------------------------------------------------------------------------
> BGS Beratungsgesellschaft
> Software Systemplanung AG
> *Niederlassung Rhein/Main*
> Robert-Koch-Straße 41
> 55129 Mainz
> Fon: +49 (0) 6131 / 914-0
> Fax: +49 (0) 6131 / 914-400
> www.bgs-ag.de <http://www.bgs-ag.de> *Geschäftssitz Mainz*
> *Registergericht*
> Amtsgericht Mainz
> HRB 62 50
> *Aufsichtsratsvorsitzender*
> Dr. Wolfgang Trommer
> *Vorstand*
> Hanspeter Gau
> Hermann Kiefer
> Nils Manegold
> Heinz-Jörg Zimmermann BGS Systemplanung AG <
http://www.bgs-ag.de>
>
> Ein Unternehmen der nextevolution consulting group
> <http://www.nextevolution.de>
>
BGS Beratungsgesellschaft
Software Systemplanung AG
Niederlassung Rhein/Main
Robert-Koch-Straße 41
55129 Mainz
Fon: +49 (0) 6131 / 914-0
Fax: +49 (0) 6131 / 914-400
www.bgs-ag.de
Geschäftssitz Mainz
Registergericht
Amtsgericht Mainz
HRB 62 50
Aufsichtsratsvorsitzender
Dr. Wolfgang Trommer
Vorstand
Hanspeter Gau
Hermann Kiefer
Nils Manegold
Heinz-Jörg Zimmermann
Re: Error with openjpa in geronimo under PostgreSQL
Posted by Rick McGuire <ri...@gmail.com>.
Josef.Eisele@bgs-ag.de wrote:
>
> Hi All,
>
> I'm quite sure that I found a bug in Geronimo, or as I assumed
> openjpa. Therefore I created an JIRA-Issue under
> https://issues.apache.org/jira/browse/OPENJPA-627.
> <https://issues.apache.org/jira/browse/OPENJPA-627>
> But nothing happens. No Votes, no Watchers....
>
> I retested functionality using openejb embedded in Eclipse with
> openjpa Version 1.1.0 but I still get the same error:
>
> I receive Errors when I try to persist Data:
>
> public class PasswortregelPAO implements Serializable {
> ....
> @Column(name="passwort_aufbau")
> private String passwortAufbau;
> ....
> ...
> entityManager.persist(pao);
> ...
>
> on DB-Fields with Definitions >= VARCHAR(170)
>
> ALTER TABLE vesuv.passwortregel DROP COLUMN passwort_aufbau;
> ALTER TABLE vesuv.passwortregel ADD COLUMN paswort_aufbau varchar(170);
> ALTER TABLE vesuv.passwortregel ALTER COLUMN passwort_aufbau SET
> STORAGE EXTEND;
>
>
> LOG:
> Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: FEHLER:
> Wert zu lang fr Typ character varying(120) {prepstmnt 32613590 INSERT
> INTO vesuv.protokoll_info (id, attribut, entitaet_id, entitaetstyp,
> wert_alt, wert_neu, protokoll_eintrag_fk) VALUES (?, ?, ?, ?, ?, ?, ?)
> [params=(long) 239, (String) passwort_aufbau, (long) 24, (String)
> PASSWORTREGEL, (String) , (String)
> dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd...,
> (long) 128]} [code=0, state=22001]
>
> With any size bigger than 170, I got the same error "FEHLER: Wert zu
> lang fr Typ character varying(120) ".
My German is a little rusty, but I believe the error message is saying
"Value too long for type character varying(120)", correct?
Did you copy-and-paste the ALTER TABLE statements above directly into
your email? There appears to be a missing "s" in the name in the "ADD
COLUMN" statement, which might explain why the type is showing up as
character varying(120) in the error message. Though why it would still
work with values up to 160 is a mystery.
If that's just a typo, then it might be a character encoding issue. I'm
not sure how PostgreSQL stores the strings, but if it's using something
like UTF-8, then a 161 character string might require more than 170
characters to store in the column. Have you tried defining the column
size greater than 170?
Rick
>
> VARCHAR-Values up to 160 work without any problem.
>
> In addition I have to say, reading of VARCHAR-Data > 170 Char. works
> without problem.
>
>
> => I tried to change the database-Definition from VARCHAR(170) to TEXT
> and to define the PAO @Column(length=200 ...) , but nothing helped.
>
>
> WHAT TO DO NOW ?
>
> cu Josef
> ------------------------------------------------------------------------
> BGS Beratungsgesellschaft
> Software Systemplanung AG
> *Niederlassung Rhein/Main*
> Robert-Koch-Straße 41
> 55129 Mainz
> Fon: +49 (0) 6131 / 914-0
> Fax: +49 (0) 6131 / 914-400
> www.bgs-ag.de <http://www.bgs-ag.de> *Geschäftssitz Mainz*
> *Registergericht*
> Amtsgericht Mainz
> HRB 62 50
> *Aufsichtsratsvorsitzender*
> Dr. Wolfgang Trommer
> *Vorstand*
> Hanspeter Gau
> Hermann Kiefer
> Nils Manegold
> Heinz-Jörg Zimmermann BGS Systemplanung AG <http://www.bgs-ag.de>
>
> Ein Unternehmen der nextevolution consulting group
> <http://www.nextevolution.de>
>