Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

No Sequence Support in MSSQL?

This is giving me the heebie jeebies: Im trying to run a JPA Application on NW 7.11 with MSSQL backend and when I deploy and run the component its giving me the following error:

Caused by: javax.persistence.PersistenceException: Id generation with a sequence is not supported for this DB vendor
at com.sap.engine.services.orpersistence.sqlmapper.mapping.JPASQLMapperImpl.createSequenceIDGeneratorSelectText(JPASQLMapperImpl.java:666)
at com.sap.engine.services.orpersistence.entitymanager.CachedJPASQLMapper.createSequenceIDGeneratorSelectText(CachedJPASQLMapper.java:254)
at com.sap.engine.services.orpersistence.generator.GeneratorFactory.<init>(GeneratorFactory.java:165)
at com.sap.engine.services.orpersistence.entitymanager.EntityManagerFactoryImpl$MetaDataImpl.<init>(EntityManagerFactoryImpl.java:285)
at com.sap.engine.services.orpersistence.entitymanager.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:121)
at com.sap.engine.services.orpersistence.entitymanager.JtaEntityManagerFactoryImpl.<init>(JtaEntityManagerFactoryImpl.java:33)
at com.sap.engine.services.orpersistence.provider.PersistenceProviderImpl.createJtaEntityManagerFactory(PersistenceProviderImpl.java:126)
at com.sap.engine.services.orpersistence.provider.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:117)
at com.sap.engine.services.orpersistence.model.persistenceunit.impl.ExtendedPersistenceUnitInfoImpl.getEntityManagerFactory(ExtendedPersistenceUnitInfoImpl.java:230)
at com.sap.engine.services.orpersistence.container.ORPersistenceObjectFactory.getEMF(ORPersistenceObjectFactory.java:289)
at com.sap.engine.services.orpersistence.container.ORPersistenceObjectFactory.getObjectInstance(ORPersistenceObjectFactory.java:70)
at com.sap.engine.lib.injection.ReferenceObjectFactory.getObject(ReferenceObjectFactory.java:67)
at com.sap.engine.lib.injection.FieldInjector.inject(FieldInjector.java:113)
... 111 more

since mssql apparently supports Sequences: http://www.onlinehowto.net/Tutorials/MSSQL/How-to-CREATE-SEQUENCE-in-MSSQL/1178 .. what is the best way to circumvent this problem?

This is one of the sequence annotations I use:

@SequenceGenerator(name = "FILEIDSEQ", sequenceName = "FILEIDSEQ", allocationSize = 1)
	@Id
	@GeneratedValue(generator = "FILEIDSEQ", strategy = GenerationType.SEQUENCE)
	private int id;

thanks in advance

Former Member
Not what you were looking for? View more on this topic or Ask a question