Hi,
I use the firebird .net provider together with the asp.net session
state store provider.
First, i got a InvalidCastException, when the session ID string is
tried to be casted to
a byte array within the command parameter.
The method this error occured is the
FbSessionStateStore.SetAndReleaseItemExclusive.
I don't understand why the Varchar 80 field (domain WP_VARCHAR80_OCTET) should
be casted to a byte[], but if it tries to I want to help, so I changed
the method and used
System.Text.Encoding.Default.GetBytes(id) to put a byte[] into the
parameter value
for the sessionid.
Now I get this error:
validation error for column SESSIONID, value "*** null ***"
The Stack trace is:
[IscException: validation error for column SESSIONID, value "*** null ***"]
FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ProcessResponse(IResponse
response) +191
FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadResponse() +68
FirebirdSql.Data.Client.Managed.Version10.GdsDatabase.ReadGenericResponse()
+13
FirebirdSql.Data.Client.Managed.Version11.GdsStatement.Execute() +391
FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery() +64
[FbException (0x1400001b): validation error for column SESSIONID,
value "*** null ***"]
FirebirdSql.Data.FirebirdClient.FbCommand.ExecuteNonQuery() +222
FirebirdSql.Web.Providers.FbSessionStateStore.SetAndReleaseItemExclusive(HttpContext
context, String id, SessionStateStoreData item, Object lockId, Boolean
newItem) +194
System.Web.SessionState.SessionStateModule.OnReleaseState(Object
source, EventArgs eventArgs) +775
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) +171
The value of the parameter is definetly not null. In the line right
before ExecuteNonQuery the parameter HAS the correct value of the
session id. Though, when tracing the statement on the database with
IBExpert, this is the result:
Statement 2225:
-------------------------------------------------------------------------------
INSERT INTO SESSIONS
(SESSIONID, APPLICATIONNAME, CREATED, EXPIRES, LOCKDATE,
LOCKID, TIMEOUT, LOCKED, SESSIONITEMS, FLAGS) VALUES
(?, ?, ?, ?, ?, ? , ?, ?, ?, ?)
param0 = varchar(80), "<NULL>"
param1 = varchar(100), ""
param2 = timestamp, "2011-05-18T20:00:05.4490"
param3 = timestamp, "2011-05-18T20:20:05.4490"
param4 = timestamp, "2011-05-18T20:00:05.4490"
param5 = integer, "0"
param6 = integer, "20"
param7 = smallint, "0"
param8 = blob, "0000000000000001"
param9 = integer, "0"
So a NULL get's send to the database, allthough the parameter value
has the correct id.
So what's wrong here?
Thanks in advance,
Sebastian
|