I have been using the auto sequence (number generation) option in my application within a multitenant environment. However, getting the following exception
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.3.7-cuba): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'SYS.SEQUENCES'.
Error Code: 208
Call: select NAME from SYS.SEQUENCES where NAME = 'SEQ_UN_DKGROUPCUSTOMERPROFILE'
Query: DataReadQuery(sql="select NAME from SYS.SEQUENCES where NAME = 'SEQ_UN_DKGROUPCUSTOMERPROFILE'")
at org.eclipse.persistence.internal.jpa.QueryImpl.getDetailedException(QueryImpl.java:391)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:264)
at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:482)
at com.haulmont.cuba.core.sys.QueryImpl.getResultFromCache(QueryImpl.java:768)
at com.haulmont.cuba.core.sys.QueryImpl.getResultList(QueryImpl.java:415)
However, If I run the query (select * from sys.sequences) it returns an empty table with many columns though.
Is this related to the read-permission of the tenant user? Which table and how?
What could be the reason and how to solve this issue, thanks for your help.