cancel
Showing results for 
Search instead for 
Did you mean: 

ORA-02289: Sequence is not available

Sharathmg
Active Contributor
0 Kudos

Hello All ,

I am stuck with a db sequence issue. I was able to save mutiple entries and there has not been much change in my JPA. I added new entities and new sequences to those entities. These sequence were also created in the DB.

Now, I get the error Caused by: javax.persistence.PersistenceException: java.sql.SQLException: ORA-02289: Sequence ist nicht vorhanden.

I have checked the name of sequence and sequence next val on the DB. It works on DB but when i execute it from ejb, it gives me this error.It gives the error for all previously working JPA entities, too.

I have also provided allocationSize = 1 for all entities.

It should not be related to authorization as I am using the admin user. Also, I am able to save entries from the central server.

Please let me know, possible cause/solution to this issue.

thank you.

Regards,

Sharath

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I have seen this error when I forget the "generator" attribute in the @GeneratedValue annotation.

Frank

Sharathmg
Active Contributor
0 Kudos

Please find the JPA entity code.

This sequence is available in oracle DB. Do you observe any flaw in the code?

@Entity
@Table(name = "POSITION")
@SequenceGenerator(name = "idGenerator", sequenceName = "SEQ_POSITION", allocationSize = 1)
public class Position implements Serializable {

	private static final long serialVersionUID = 1L;

		
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "idGenerator")
	private long id;

Error trace:

[EXCEPTION]

javax.ejb.EJBException: ASJ.ejb.005044 (Failed in component: bosch.com/javampa_ear) Exception raised from invocation of public void com.bosch.mpa.session.RefDataFacade.save(com.bosch.mpa.entity.refdata.aca.CompetenceArea) method on bean instance com.bosch.mpa.session.RefDataFacade@1c72956 for bean bosch.com/javampa_earannotation|bosch.comjavampa_ejb.jarannotation|RefDataFacade in application bosch.com/java~mpa_ear.; nested exception is: javax.persistence.PersistenceException: java.sql.SQLException: ORA-02289: Sequence ist nicht vorhanden.

javax.persistence.PersistenceException: java.sql.SQLException: ORA-02289: Sequence ist nicht vorhanden.

at com.sap.engine.services.orpersistence.core.PrimaryKey.generateIdValues(PrimaryKey.java:133)

at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.cascadeMerge(PersistenceContextImpl.java:1632)

at com.sap.engine.services.orpersistence.core.PersistenceContextImpl.merge(PersistenceContextImpl.java:842)

Thank you.

Regards,

Sharath M H

Edited by: Sharath M G on Dec 5, 2011 4:49 PM

Sharathmg
Active Contributor
0 Kudos

The tables were re-created and issues were resolved.

former_member188883
Active Contributor
0 Kudos

Hi,

It will be a privileges problem, you need to have the correct permissions granted to the sequence for the user you are logging in as

Please try the command

grant all on <sequence> to <user>;

Hope this helps.

Regards,

Deepak Kori