Results 1 to 5 of 5
  1. #1
    javadev is offline Member
    Join Date
    Jun 2007
    Posts
    14
    Rep Power
    0

    Default problem with hibernate and oracle 8i

    hello everyone,

    i am using hibernate with oracle 8i and sql-server2000

    i am trying to insert value which have sequence field(identity in sql-server).

    when i tries it ,it throws following an exception

    org.hibernate.exception.GenericsJDBCException: could not get next sequence value

    i am using <generator class="native"/>.

    it works well with sql-server2000.

    if any one has a idea please help me.

    thanks in advance,
    Javadev

  2. #2
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Posts
    134
    Rep Power
    0

    Default

    you need to have sequence for it , just execute "create sequence hibernate_sequence " in the oracle prompt then it will work

  3. #3
    javadev is offline Member
    Join Date
    Jun 2007
    Posts
    14
    Rep Power
    0

    Default

    hi goldhouse,

    thanks for u r help...

    i have already created sequence...
    but i can`t get it.
    i use following for id.
    <generator class="native">
    <param name="sequence">sq_hibernate_sequence</param>
    </generator>


    but i am confused that how i get next sequence value and how i can set it and insert into table?????

    if u have an idea please help me.

    thanks in advance.
    javadev

  4. #4
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Posts
    134
    Rep Power
    0

    Default

    You are mixing up

    either

    <generator class="sequence">
    <param name="sequence">sq_hibernate_sequence</param>
    </generator>

    or
    <generator class="native">
    </generator>
    In the second case , you need to have a sequence named 'hibernate_sequence'

  5. #5
    javadev is offline Member
    Join Date
    Jun 2007
    Posts
    14
    Rep Power
    0

    Default

    hello goldhouse,

    when i am creating hibernate_sequence it works fine.

    but i have two tables with two different sequences.how i can use existing sequences for particular table.

    thanks in advance.
    javadev

Similar Threads

  1. composite-id problem hibernate
    By javadev in forum JDBC
    Replies: 14
    Last Post: 07-27-2009, 07:30 PM
  2. Replies: 4
    Last Post: 08-09-2007, 11:41 PM
  3. oracle problem
    By Peter in forum JDBC
    Replies: 1
    Last Post: 07-09-2007, 05:19 AM
  4. can hibernate work with Oracle 10g
    By javadev in forum JDBC
    Replies: 4
    Last Post: 07-08-2007, 09:47 PM
  5. Log4J, problem with Hibernate and Spring
    By Marcus in forum Advanced Java
    Replies: 1
    Last Post: 06-06-2007, 04:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •