Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
Forget about the previous comment about the brackets.
The Code variable _source is null so the Source property returns an empty string
(""). So the value for the Parameter for the stored procedure is the empty
string.
When i try to run the stored procedure in oracle sql developer and insert an
empty
string for the source coulmn it does NOT work, too.
It seems that oracle tries to convert the empty string to a NULL.
You can reproduce this error even with an insert statement:
INSERT INTO "VDI"."ELMAH$ERROR"
(ERRORID, APPLICATION, HOST, TYPE, source, MESSAGE, USERNAME, STATUSCODE,
TIMEUTC,
SEQUENCENUMBER, ALLXML)
VALUES
('13', '12', '12', '12', '', 's', '12', '12', TO_DATE('04.09.08', 'DD.MM.RR'),
'2',
'(CLOB) <?xml version="1.0" encoding="utf-16"?>
<error')
So how to fix this in elmah (or oracle not to convert '' to NULL)?
Original comment by to.ko...@gmail.com
on 5 Sep 2008 at 9:24
[deleted comment]
for a workaround i thought:
maybe if i set the applicationName in web.config:
<errorLog type="Elmah.OracleErrorLog, Elmah" connectionStringName="myDB"
applicationName="myApplicationName" />
but this isn't used for the source column (not for signaling errors (and not for
bubble up exception errors to the runtime) :().
the applicationName is only for the application column
Original comment by to.ko...@gmail.com
on 5 Sep 2008 at 9:59
This will do the trick:
please add:
if (error.Source.Length == 0)
{
error.Source = "none";
}
see below:
public override string Log(Error error)
{
if (error == null)
throw new ArgumentNullException("error");
string errorXml = error.ToXmlString();
Guid id = Guid.NewGuid();
if (error.Source.Length == 0)
{
error.Source = "none";
}
...
Original comment by to.ko...@gmail.com
on 5 Sep 2008 at 10:20
Although the fix suggested above will work, it is not ideal!
The Oracle schema was put together based on the SQL Server implementation,
however,
there is a big difference in the way that these 2 databases handle empty
strings
(""). Oracle treats "" as a NULL string, whereas SQL Server differentiates
between
the two.
Therefore, I have checked in a new version of Oracle.sql (Revision 379) which
simply
removes the NOT NULL constraint from the Source column.
You should be able to fix existing deployments by issuing the following command:
ALTER TABLE elmah$error MODIFY (Source NULL);
Original comment by jamesdriscoll71
on 6 Sep 2008 at 10:17
Original issue reported on code.google.com by
to.ko...@gmail.com
on 4 Sep 2008 at 4:04