-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: insert problem (struts2+hibernate+postgre)
PostPosted: Sat May 23, 2009 7:59 pm 
Newbie

Joined: Sat May 23, 2009 7:50 pm
Posts: 4
hi,
i have a problem with inserting a row to the table. I'm using struts2 + hibernate + postgre. The problem is that, i have a table which have 8 columns and when i try to insert a new row to the table, i get the following error.
Code:
Hibernate:
    select
        nextval ('kisi_pk_seq')
Hibernate:
    insert
    into
        kisi
        (ad, adres, cep_no, dogum_tarihi, mail, soyad, tel_no, DTYPE, id)
    values
        (?, ?, ?, ?, ?, ?, ?, 'Kisi', ?)
24.May.2009 02:34:32 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: null
24.May.2009 02:34:32 org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Tpilı iş girişi 0 insert into kisi (ad, adres, cep_no, dogum_tarihi, mail, soyad, tel_no, DTYPE, id) values (mahmut, malatya, 5333699129, 3886-08-01 +03:00:00, g@hotmail.com, tuncer, 5333699129, 'Kisi', 450) durduruldu.  Nedenini görmek için getNextException fonksiyonu çağırın.
24.May.2009 02:34:32 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: 42703
24.May.2009 02:34:32 org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ERROR: column "dtype" of relation "kisi" does not exist
24.May.2009 02:34:32 org.hibernate.event.def.AbstractFlushingEventListener performExecutions
SEVERE: Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
   at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
   at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:237)
   at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
   at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
   at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
   at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
   at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
   at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
   at com.AKS.util.HibernateUtil.save(HibernateUtil.java:56)
   at com.AKS.veriTabani.KisiVeriTabani.kisiEkle(KisiVeriTabani.java:16)
   at com.AKS.veriTabani.deneme.main(deneme.java:12)
Caused by: java.sql.BatchUpdateException: Tpilı iş girişi 0 insert into kisi (ad, adres, cep_no, dogum_tarihi, mail, soyad, tel_no, DTYPE, id) values (mahmut, malatya, 5347699129, 3886-08-01 +03:00:00, g@hotmail.com, tuncer, 5347699129, 'Kisi', 450) durduruldu.  Nedenini görmek için getNextException fonksiyonu çağırın.
   at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2528)
   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1344)
   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:344)
   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2663)
   at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
   at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
   ... 10 more


The problem is the table doesn't have a column with type DTYPE. And i guess i am getting the error because of it. Just to be sure i have tried to insert to an another table and there wasn't any column with type DTYPE and neither an error. Here is the result of that query:

Code:
Hibernate:
    insert
    into
        sehir
        (ad, kod)
    values
        (?, ?)


(Sorry, some parts of the outputs are Turkish)

So, what can be the problem?
thanks in advance..


Top
 Profile  
 
 Post subject: Re: insert problem (struts2+hibernate+postgre)
PostPosted: Sun May 24, 2009 6:06 am 
Newbie

Joined: Sat May 23, 2009 7:50 pm
Posts: 4
i found out the problem. I was using inheritance and i didn't know that i needed to specify the descriminator column.
thanks anyway..


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.