Folks--
I'm working on an ajax kind of thing and when my html page loads, I attempt to init the page's data structures by firing off many XmlHttpRequests.
When I fire off two of them, things work fine. (One populates the main data I want to display on the page, another populates a form with some drop down list.)
When I add a third asynchronous request, things break. Alas, I'm not exactly sure how to explain it.
The way I'm seeing it at the moment is that the Oracle OCI shared lib throws an exception ORA-21500 which takes down SBCL, I think, or at least slime.
So, just to rule things out: there's no possible way this can be some problem with tbnl (0.8.9 on SBCL), right? Each of those asynchronous requests should be coming in on a separate thread and things should work accordingly. Right? ;)
Surely it can't be the clsql oracle interface which can't handle simultaneous requests? Do I need to block on clsql requests?
Anyway, curious to know if any of you have encountered this sort of problem before.
Keith
On Fri, 16 Dec 2005 11:44:53 -0800, Tolstoy tolstoy@zentrope.com wrote:
I'm working on an ajax kind of thing and when my html page loads, I attempt to init the page's data structures by firing off many XmlHttpRequests.
When I fire off two of them, things work fine. (One populates the main data I want to display on the page, another populates a form with some drop down list.)
When I add a third asynchronous request, things break. Alas, I'm not exactly sure how to explain it.
The way I'm seeing it at the moment is that the Oracle OCI shared lib throws an exception ORA-21500 which takes down SBCL, I think, or at least slime.
So, just to rule things out: there's no possible way this can be some problem with tbnl (0.8.9 on SBCL), right? Each of those asynchronous requests should be coming in on a separate thread and things should work accordingly. Right? ;)
Surely it can't be the clsql oracle interface which can't handle simultaneous requests? Do I need to block on clsql requests?
Anyway, curious to know if any of you have encountered this sort of problem before.
Hmm, that's a tough one because it involves many diverse libraries. As you'll know yourself the best way to track this down is to find a reproducible situation that's as easy as possible. I can't really help unless you are more specific but here are some ideas:
1. Take SLIME out of the picture and check if the problems are still there. There's a slim chance that the way SLIME communicates with SBCL is the culprit and you can obviously confirm or refute this by working from the command line.
2. Can you try the same with some other Lisp like CMUCL? SBCL uses native threads on Linux while most other Lisps at the moment don't. If the error goes away with CMUCL then at least you know where to dig further.
3. Oracle can definitely handle simultaneous requests but of course you need a different database connection for each thread. If you don't have that this is most likely where your problems come from.
ORA-21500 seems to imply some problem on the client side so I guess it's something like #2 or #3. If it's not #3 (pilot error) it might as well be that there's a bug in CLSQL that nobody has encountered yet because not many people use CLSQL with Oracle and SBCL.
And of course this can also be a problem with TBNL. I don't think TBNL is free of errors - it's just that this sounds more like something else.
Cheers, Edi.
On Fri, 2005-12-16 at 21:09 +0100, Edi Weitz wrote:
On Fri, 16 Dec 2005 11:44:53 -0800, Tolstoy tolstoy@zentrope.com wrote:
I'm working on an ajax kind of thing and when my html page loads, I attempt to init the page's data structures by firing off many XmlHttpRequests.
When I fire off two of them, things work fine. (One populates the main data I want to display on the page, another populates a form with some drop down list.)
When I add a third asynchronous request, things break. Alas, I'm not exactly sure how to explain it.
The way I'm seeing it at the moment is that the Oracle OCI shared lib throws an exception ORA-21500 which takes down SBCL, I think, or at least slime.
- Oracle can definitely handle simultaneous requests but of course you need a different database connection for each thread. If you don't have that this is most likely where your problems come from.
This was indeed the problem, as I suspected just after hitting the "send" button. If I add :if-exists :new to the (with-connection) macro, things work as I expect. If I add :pool t, however, transactions don't seem to be committed even if I explicitly (set-autocommit t). But this isn't the place, I guess, to discuss that.
ORA-21500 seems to imply some problem on the client side so I guess it's something like #2 or #3. If it's not #3 (pilot error) it might as well be that there's a bug in CLSQL that nobody has encountered yet because not many people use CLSQL with Oracle and SBCL.
I think the prob was attempting to use the same connection simultaneously. The solution is either to acquire a lock, or create a new connection for each transaction (which I imagine is a performance issue). I think the error came from the shared lib itself, rather than SBCL or CLSQL.
And of course this can also be a problem with TBNL. I don't think TBNL is free of errors - it's just that this sounds more like something else.
Yeap. I couldn't think of why TBNL would be at fault, but figured a lot of people use the two tools together, so....
Anyway, thanks for the help! ;)
Keith
Cheers, Edi.