Tuesday, August 12, 2008

Les Miserables

I've started reading The Miserables by Victor Hugo. As I started I was a little skeptic
but I rapidly turned to enthusiastic.
It is a strange reading, sometimes painful (like some Puccini or Verdi opera's libretto). Most ofter it's a pleasure. I know nothing about Hugo, I don't like reading
critical essays (or simply book introductions) before reading the book itself.
Maybe I'll read after. For now it is amazing how Hugo seems to trying to keep together a strong religiosity with the admiration for the french revolution ... also it is amazing how much mental prejudices he had , unconsciounsly (does this word exist in english ?) ....
a lesson for today and for every time ... we all have mental blindnesses, we simply can't see them, no matter how "open minded" we are (or claim to be) ..

Tuesday, July 22, 2008

Borges, Bacon and Oracle

Today a colleague of mine called me to watch a strange problem. A Delphi written program refused, on his pc, to connect to an Oracle instance giving the error:
"ORA-12154: TNS:could not resolve the connect identifier specified".
I checked the connection string and it seemed correct. I tried connecting with tnsping and then with sqlplus and they all succeed.
Then I checked the same program on my pc, and there it worked. At that moment a bell rang in my head. I came back at my colleague's desk and looked at the folder name in which the program was stored. It was "Jobtime WF (exe)".
It seems that Oracle OCI doesn't like path with parenthesis. Changing the folder name fixed the error.
I had already met this error in year 2000, when I started working with Oracle, but from then I forgot it. This kind of thing happened to me quite often.
I mean I often feel that some technical detail become new just because I forgot it.
It always reminds to me a quote used by epigraph by Borges, at the beginning of "El Aleph":

Salomon saith: There is no new thing upon the earth. So that as Plato had an immagination, that all knowledge was but remembrance; so Salomon giveth his sentence, that all novelty is but oblivion.

Francis Bacon: Essays, LVIII

Sunday, July 20, 2008

Back from Sicily!

We have been in Sicily the last week of June.
We started from Palermo and then moved to the beautiful "Riserva dello Zingaro" regional park.
After that we have spent three days in Favignana. We have been also to Erice, Segesta, Mozia and, finally, Selinunte.
I have just published on picasaweb a first album of photographs. This is the first time I use this feature and I must admit that ... it's funny !
Bye
PS
Oops I forgot the album link, here it is:
http://picasaweb.google.com/Nicola.Farina64/2008JuneSicily

Thursday, June 19, 2008

Javascript include redux

Today I had little accident with my ASP.NET project.
I have a master page which includes some javascript files, and several pages derived from this master page. Today, to better organize my code, I created a sub-folder in which I moved some of these pages. After doing that, these pages were no more able to include my javascript files.
After some "googling".
The include line format was this:

src="Scripts/FmMaskStorico.js"

I tried adding the tilde character:

src="~/Scripts/FmMaskStorico.js"

But with no success. It seems that ASP.NET interprets the tilde character only for server controls, while leaving to the browser the handling of script includes like this.
Another option I found was using the syntax :
src="<%=Request.ApplicationPath%>/Scripts/FmMaskStorico.js"
Unfortunately I can't use this option since I create all controls dynamically and it seems that this is not compatible with the <% %> syntax.
Well at the end I resolved deleting the static includes in the master page aspx, substituting them with some
calls to Page.ClientScript.RegisterScriptInclude.
This way I got it.
Phew .....


Friday, June 13, 2008

Privileges to analyze another schema

Yesterday I wrote a small stored procedure to gather statistics for several schemas at a customer's site.
The procedure was very simple, but trying it gaves me error:
ORA-01031 insufficient privileges

I checked that the user I was using had the "analyze any" right. To be sure I granted it again.
But I still got the error.
The database was a 9.2.0.8. Even here Metalink at the rescue, with note 203220.1.
It turned out that there was a bug. The workaround to be applied was quite obvious:
grant select any table to my user.
Not the best from the security point of view, but it fits my needs..
So, once again, thanks Metalink!

Sunday, June 8, 2008

Thanks Metalink!

This week I found a new (for me :-)) way to investigate Oracle problems.
We had a problem at a customer site with a new application. A query suddenly failed with very nasty error "not connected to Oracle". Same query runs smoothly at our office but we developed on 10.2 while this customer was still on 9.2.0.6
(by the way, not a very wise choice I suppose).
Anyway I had only little time to fix, the problem was blocking the first demo of this very important (for us) new app with the customer.
Firstly I gave a look in the core log. Initially I was a little hopeless because informations in there seemed a little confusing but looking at the stack trace
I had my idea of the week: looking at the following line:

------------------- Call Stack Trace ---------------------
Frameptr RetAddr Param#1 Param#2 Param#3 Param#4 Function Name
0x0a56b888 011c2fee 0a56b948 00000001 09849b10 050f7208 _qeruaRowProcedure+1

I guessed that a function called "qeruaRowProcedure" should have failed.
So I tried a search on Metalink by keyword
qeruaRowProcedure and (voilĂ ) I found
quite some documents regarding problems with this function.
In one of them I found the workaround I was looking for, which was
setting the hidden parameter
_complex_view_merging to false.
I immediately tried this workaround and it worked! The query started running again
and the new app demo was able to complete.
One thing to keep in mind: the first documents I read in my Metalink search were hopeless in the sense they stated that there was no workaround for the problem (unless upgrading go 11 which was impossibile for me at the moment: I had to fix the problem almost instantly....) but at last I found at least one doc with the above workaround. So the advice is: keep searching..

A couple of days after we had a similar accident, but this time at our office, with a developing instance of 10.2.0.4.

I applied the same technique: look in the stack trace in the core log, identify the failing function and search metalink.
This time the stack trace line was this:

Frameptr RetAddr Param#1 Param#2 Param#3 Param#4 Function Name
0x0cad7ad8 00eace2d 8152d9d8 09abd544 0e8f8b08 00000000 _delrefi+34

And the workaround was in this document:

ORA-7445 [Delrefi] Where Delete Occurs
Doc ID: Note:463899.1

In this doc there are actually a couple of workarounds:

#1 Set "_optimizer_join_elimination_enabled"=false .
or
#2 Apply the one off patch for this bug.

Since the note was about 10.2.0.3 and the db I was using was 10.2.0.4
I choose to follow #1.

Note that it seems you can't simply use:

alter session set "_optimizer_join_elimination_enabled"=false

because sqlplus gives error ("identifier is too long").
It seems to work as "alter system" only.

At the end I must say: thanks Metalink!



Tuesday, April 15, 2008

A backward country

Today I am very sad. Italians decided to give credit to Mr. Berlusconi for another government.
Again. Another time, the third.
After two government (1993-1994 and 2001-2005) that were among the worst of Italy's history (and it is a difficult competition, believe me!). Since the end of the XIX century, at least.
We are going to be governed again by a man who owns nearly the whole television system of the country (not to tell about banks, newspaper and god knows what else).
A man who has a very backward concept of women, who has told that Vittorio Mangano (a mafia boss dead in prison some years ago) that worked at his house was an "hero" etc... etc...
What a shame ! Around the world people must think Italy is a very backward country and .. do you know what ? They're absolutely right !

Monday, April 14, 2008

An homemade framework

The main project I am working at the moment is the Asp.Net client for an application development framework we wrote a couple of years ago.
This framework is (heavily) based on a Oracle database, and includes a form designer, a report designer and a query designer client applications (all of them are native win32 applications written in Delphi). This framework allows you to define a complete application without writing native code.
Well, almost a line. In fact, a part from a very very simple application, you have to write some sql and/or pl/sql code; perhaps some scripts in a pseudo-Delphi interpreter which is also included in the system. But that's all. You haven't to write native Delphi code.
My company registered this system with the musically name of "Ouverture".
More on this in the next posts...

First post

Hello all,

The purpose of this blog is to share (and help me organize) thoughts about my work and like.
I have been working as a computer programmer since 1988 and have seen many different
technologies since then.
But this will be in my profile, I'll update it as soon as possible.
Bye
Nicola