Friday, October 12, 2012

Why so many login sessions?

Recently I was working on some maintenance stuff for some crystal reports. And I stumbled upon a peculiar problem.
The report had 4 sub reports in it and it was running out of available login sessions in about 10 runs. The problem was I'm at average level when it comes to .net and a newbie to crystal reports. So I'm just discovering things and half the time I don't know where I'm going. That of course sucks but I can't help it. The workload is more than enough that every day I go to my rented place completely exhausted and badly in need of sleep.
Anyway that's beside the point. The thing is that I didn't even know what is causing the "no more login sessions available" error. So after some discovering on the internet I learned some things about Oracle logins and login sessions. The solution seemed very simple - increase maximum number of login sessions in oracle.
But I knew I have to fix the root cause of this. And the root cause is in the report and the code that generates it.
So I'm again in the code looking for things where there might be a new session getting created. Well, after some careful sniffing I couldn't find anything in the functions block. Well, what now. Then I remembered that I have some more functions pulling data that reside in another source file and I am yet to check them. So after a furious search I found the culprit functions.
So after carefully editing the things and making everything work right, I have the report working much better.
Still something is not alright. I'm still losing one session let run and the connection pool is exhausted by 30th run or so. But luckily for me nobody is going to use it for that long so at least I can push it to production.
Good job!

Sent from my Windows Phone

No comments:

Post a Comment