Basically, I wish to fetch a filtered set of objects from the database (Oracle 9.2) based on the id property of the object PsalertsEvent. The code being executed is:
Public Overloads Function GetAll(ByVal laterThan As Long, ByVal filteredPsalertsEvents As IList) As IList Implements IPsalertsEventRepo.GetAll
'Get all psalerts events with an ID greater then the specified laterThan parameter
filteredPsalertsEvents = MyBase.NHibernateSession.CreateQuery("from PsalertsEvent p where p.id > " & laterThan).List
Return filteredPsalertsEvents
End Function
NUnit generates the following text ouput:
* PsalertsIp.Tests.Data.PSALERTSEventRepoTests.CanGetUnprocessedPsalertsEvents
NHibernate: select max(psalertsev0_.Id) as col_0_0_ from ALARM_REPLAY_NEW psalertsev0_ NHibernate: select psalertsev0_.Id as Id0_, psalertsev0_.ALARM_SUBSTATION_NAME as ALARM2_0_, psalertsev0_.ALARM_BUSBAR_NUM as ALARM3_0_, psalertsev0_.ALARM_COMPONENT_ALIAS as ALARM4_0_, psalertsev0_.ALARM_NAME as ALARM5_0_, psalertsev0_.ALARM_TEXT as ALARM6_0_, psalertsev0_.ALARM_TIME as ALARM7_0_ from ALARM_REPLAY_NEW psalertsev0_ where psalertsev0_.Id>20118832 NHibernate: UPDATE ALARM_REPLAY_NEW SET ALARM_SUBSTATION_NAME = :p0, ALARM_BUSBAR_NUM = :p1, ALARM_COMPONENT_ALIAS = :p2, ALARM_NAME = :p3, ALARM_TEXT = :p4, ALARM_TIME = :p5 WHERE Id = :p6;:p0 = 'Value Text', :p1 = 0, :p2 = 'Value Text', :p3 = NULL, :p4 = 'CLOSED', :p5 = 10/03/2010 15:06:31, :p6 = 20118833 15:06:56,389 ERROR [TestRunnerThread] AbstractBatcher [(null)]- Could not execute command: UPDATE ALARM_REPLAY_NEW SET ALARM_SUBSTATION_NAME = :p0, ALARM_BUSBAR_NUM = :p1, ALARM_COMPONENT_ALIAS = :p2, ALARM_NAME = :p3, ALARM_TEXT = :p4, ALARM_TIME = :p5 WHERE Id = :p6 Oracle.DataAccess.Client.OracleException ORA-01031: insufficient privileges at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src)
at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQuery()
at NHibernate.AdoNet.AbstractBatcher.ExecuteNonQuery(IDbCommand cmd)
NUnit passes the test in question, however an error is subsequently generated centered on the oracle exception:
Oracle.DataAccess.Client.OracleException ORA-01031: insufficient privileges