openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: AW: persist List<String>
Date Mon, 12 Oct 2009 23:52:22 GMT

Hi,
  Apparently, der Tabelle "T7.TESTANNOTATION_TESTLISTE" has already been
defined in database schema. Now as you have  changed the object-relational
mapping definition, the database schema
should be different. OpenJPA expects the schema to be something (according
to the new definition),
checks the database and sees that the database schema ist nicht kompatibel
and hence complains.

  The easiest will be to drop der Tabelle "T7.TESTANNOTATION_TESTLISTE". If
that is not possible,
trying altering its column type that ist nicht kompatibel.

  Danke --

Pinaki

 

Scherer, Annette wrote:
> 
> Thank you for your answer
> I made following annotations 
> 
> @Entity
> @Table(name="TESTANNOTATION")
> public class TestListAnnotationImpl implements TestListAnnotation,
> Serializable{
> 	@Id
> 	@GeneratedValue(strategy=GenerationType.TABLE)
> 	private String id;
> 	
> 
> 	@PersistentCollection
> 	private List<String>testListe;
> 	
> 	public TestListAnnotationImpl() {
> 		super();
> 	} 
> 
> And get this new Exception. Do you have a correct example?
> 
> 
> 843  Filmverleih_DB  WARN   [main] openjpa.jdbc.Schema - Die vorhandene
> Spalte "TESTLISTANNOTATIONIMPL_ID" in der Tabelle
> "T7.TESTANNOTATION_TESTLISTE" ist nicht kompatibel mit derselben Spalte in
> der angegebenen Schemadefinition. Vorhandene Spalte:
> Full Name: TESTANNOTATION_TESTLISTE.TESTLISTANNOTATIONIMPL_ID
> Type: bigint
> Size: 19
> Default: null
> Not Null: false
>  Angegebene Spalte:
> Full Name: TESTANNOTATION_testListe.TESTLISTANNOTATIONIMPL_ID
> Type: varchar
> Size: 254
> Default: null
> Not Null: false
> 
> 890  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 58852226> executing stmnt 468589550 CREATE TABLE T7.TESTANNOTATION (id
> VARCHAR(254) NOT NULL, PRIMARY KEY (id))
> 984  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 58852226> [94 ms] spent
> 39687  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 284889339> executing prepstmnt 1136214969 SELECT SEQUENCE_VALUE FROM
> T7.OPENJPA_SEQUENCE_TABLE WHERE ID = ?  FOR READ ONLY WITH RS USE AND KEEP
> UPDATE LOCKS [params=(int) 0]
> 39702  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 284889339> [15 ms] spent
> 39702  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 284889339> executing prepstmnt 1696752930 UPDATE T7.OPENJPA_SEQUENCE_TABLE
> SET SEQUENCE_VALUE = ? WHERE ID = ? AND SEQUENCE_VALUE = ? [params=(long)
> 134651, (int) 0, (long) 134601]
> 39702  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 284889339> [0 ms] spent
> 39718  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> executing prepstmnt 718613205 INSERT INTO T7.TESTANNOTATION
> (id) VALUES (?) [params=(String) 134601]
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> [16 ms] spent
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> batching prepstmnt 853422814 INSERT INTO
> T7.TESTANNOTATION_testListe (TESTLISTANNOTATIONIMPL_ID, element) VALUES
> (?, ?) [params=(String) 134601, (String) aaaaa]
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> [0 ms] spent
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> batching prepstmnt 853422814 INSERT INTO
> T7.TESTANNOTATION_testListe (TESTLISTANNOTATIONIMPL_ID, element) VALUES
> (?, ?) [params=(String) 134601, (String) bbbbb]
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> [0 ms] spent
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> batching prepstmnt 853422814 INSERT INTO
> T7.TESTANNOTATION_testListe (TESTLISTANNOTATIONIMPL_ID, element) VALUES
> (?, ?) [params=(String) 134601, (String) ccccc]
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> [0 ms] spent
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> executing batch prepstmnt 853422814 INSERT INTO
> T7.TESTANNOTATION_testListe (TESTLISTANNOTATIONIMPL_ID, element) VALUES
> (?, ?) [params=(String) 134601, (String) ccccc]
> 39734  Filmverleih_DB  TRACE  [main] openjpa.jdbc.SQL - <t 109577864, conn
> 699017642> [0 ms] spent
> Exception in thread "main" <openjpa-1.2.1-r752877:753278 fatal store
> error> org.apache.openjpa.persistence.RollbackException: Das Rollback der
> Transaktion ist abgeschlossen. Suchen Sie in den verschachtelten Ausnahmen
> nach Einzelheiten zu den aufgetretenen Fehlern.
> 	at
> org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:523)
> 	at fv.bo.persist.DataPersistorMain.main(DataPersistorMain.java:45)
> Caused by: <openjpa-1.2.1-r752877:753278 fatal general error>
> org.apache.openjpa.persistence.PersistenceException: Das Rollback der
> Transaktion ist abgeschlossen. Suchen Sie in den verschachtelten Ausnahmen
> nach Einzelheiten zu den aufgetretenen Fehlern.
> 	at
> org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2163)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2010)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
> 	at
> org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1826)
> 	at
> org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
> 	at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1350)
> 	at
> org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:877)
> 	at
> org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:512)
> 	... 1 more
> Caused by: <openjpa-1.2.1-r752877:753278 nonfatal general error>
> org.apache.openjpa.persistence.PersistenceException: Non-atomic batch
> failure.  The batch was submitted, but at least one exception occurred on
> an individual member of the batch. Use getNextException() to retrieve the
> exceptions for specific batched elements.SQLCA OUTPUT[Errp=SQLRI1EC,
> Errd=-2145779603, 0, 0, 0, -80, 0]
> Error for batch element #0: DB2 SQL error: SQLCODE: -301, SQLSTATE: 07006,
> SQLERRMC: 1
> Error for batch element #1: DB2 SQL error: SQLCODE: -301, SQLSTATE: 07006,
> SQLERRMC: 1
> Error for batch element #2: DB2 SQL error: SQLCODE: -301, SQLSTATE: 07006,
> SQLERRMC: 1
> FailedObject: prepstmnt 853422814 INSERT INTO T7.TESTANNOTATION_testListe
> (TESTLISTANNOTATIONIMPL_ID, element) VALUES (?, ?)
> [org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement]
> 	at
> org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4232)
> 
> 
> Annette Scherer
> Abteilung Informatik
> 
> HUK-COBURG
> Bahnhofsplatz
> 96444 Coburg
> Telefon  09561 96-1718
> Telefax  09561 96-3671
> E-Mail   Annette.Scherer@HUK-COBURG.de
> Internet www.HUK.de
> =============================================================
> HUK-COBURG Haftpflicht-Unterstützungs-Kasse kraftfahrender Beamter
> Deutschlands a. G. in Coburg
> Reg.-Gericht Coburg HRB 100; St.-Nr. 9212/101/00021
> Sitz der Gesellschaft: Bahnhofsplatz, 96444 Coburg
> Vorsitzender des Aufsichtsrats: Werner Strohmayr.
> Vorstand: Dr. Wolfgang Weiler (Sprecher), Wolfgang Flaßhoff, Stefan
> Gronbach, Klaus-Jürgen Heitmann, Dr. Christian Hofer.
> =============================================================
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Pinaki Poddar [mailto:ppoddar@apache.org] 
> Gesendet: Freitag, 9. Oktober 2009 21:55
> An: users@openjpa.apache.org
> Betreff: Re: persist List<String>
> 
> 
> Hi,
>    See @PersistenceCollection annotation in [1].
> 
> [1]
> http://openjpa.apache.org/builds/latest/docs/manual/manual.html#ref_guide_meta_jpa_persistent_coll
> 
> 
> Scherer, Annette wrote:
>> 
>> Hello all,
>> 
>> When enhancing class FilmImpl I get this exception:
>> 
>> Exception in thread "main" <openjpa-1.2.1-r752877:753278 fatal user
>> error>
>> org.apache.openjpa.util.MetaDataException: 
>> Der Typ des Feldes "fv.bo.FilmImpl.bonusMaterialListe" wird von der
>> deklarierten Persistenzstrategie "OneToMany" nicht unterstützt. 
>> Wählen Sie eine andere Strategie aus.
>> 	at
>> org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser.parseOneToMany(AnnotationPersistenceMetaDataParser.java
>> 
>> 
>> This are my annotations:
>> 
>> public class FilmImpl implements Film, Serializable {
>> 	@Id
>> 	@GeneratedValue(strategy=GenerationType.TABLE)
>> 	private String id;
>> 	
>> 	@OneToMany(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST})
>> 	private List<String> bonusMaterialListe;
>> 
>> I dont need an extra class definition for "BonusMaterial"
>> 
>> 
>> 
>> Thank you for your advice
>> Annette Scherer
>> 
>> 
> 
> 
> -----
> Pinaki 
> -- 
> View this message in context:
> http://n2.nabble.com/persist-List-String-tp3795901p3796904.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
> 
> 


-----
Pinaki 
-- 
View this message in context: http://n2.nabble.com/persist-List-String-tp3795901p3811500.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message