Skip to Main Content

Japanese

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Hibernate & Oracle ERROR JDBCExceptionReporter:78 - ORA-02289: sequence does not exist

I am trying to insert a record to the Oracle table through Hibernate. I am getting the following error message.

These are the objects i have created in oracle database by coneccting with user 'Rita'

1)Creation of table ‘READING’

----------------------------

create table Maller.READING(

ID NUMBER(15) primary key,

SITE_ID VARCHAR2(15),

ACCUMULATED FLOAT,

CREA_DATE DATE,

PROC NUMBER(1));

Table created.

Created READING table in maller schema.

2)Creation of a sequence READING_SEQ

------------------------------------

Create sequence READING_SEQ

start with 1000000001                                               

increment by 1;

Sequence created

3)Creation of a trigger 'READING_TRI' on a 'READING' table

-----------------------------------------------------------

CREATE OR REPLACE TRIGGER READING_TRI

BEFORE INSERT

ON Maller.READING

REFERENCING NEW AS NEW

FOR EACH ROW

BEGIN

SELECT READING_SEQ.nextval INTO :NEW.ID FROM dual;

END;

/

Trigger created

4) Rita user has the following access rights.

select * from user_sys_privs;

USERNAME                       PRIVILEGE                                ADM

------------------------------ ---------------------------------------- ---

Rita CREATE OPERATOR                          NO

Rita                   CREATE ANY PROCEDURE                     NO

Rita                   DROP ANY TABLE                           NO

Rita                   CREATE ANY TRIGGER                       NO

Rita                   CREATE PROCEDURE                         NO

Rita                   ALTER ANY TABLE                          NO

Rita                   CREATE SESSION                           NO

Rita                  CREATE SEQUENCE                          NO

Rita                  INSERT ANY TABLE                         NO

Rita                   SELECT ANY TABLE                         NO

Rita                  CREATE ANY INDEXTYPE                     NO

Rita                  CREATE ANY INDEX                         NO

Rita                   UNLIMITED TABLESPACE                     NO

Rita                  CREATE TABLE                             NO

Rita                  CREATE INDEXTYPE                         NO

Rita                  CREATE TYPE                              NO

Rita                  DELETE ANY TABLE                         NO

Rita                   CREATE TRIGGER                           NO

Rita                  CREATE CLUSTER                           NO

Rita                  CREATE ANY TABLE                         NO

5) We have granted the following rights to 'maller' and 'rita' after the error message we got.

As the Rita user we ran:

GRANT all on  READING_SEQ to maller;

As the maller user we ran:

GRANT all on  READING to Rita ;

6)Here strange thing is I am able to insert a record in a READING table  from oracle database by simply writing 'Insert' query in sqlplus client window, But it was not working from hibernet getting the following error message

ERROR JDBCExceptionReporter:78 - ORA-02289: sequence does not exist

I don't know  what i am missing out here.

I would be very thankful to you if anyone provide the solution

Thanks once again.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2014
Added on Oct 9 2014
0 comments
1,720 views