MySQL Forums
Forum List  »  Stored Procedures

Re: Dynamic Sql Statement in SP
Posted by: Roland Bouman
Date: January 10, 2006 01:49PM

Hi Ming!

Ming Yeung wrote:
> I believe the sessions of the MySql user are not
> being released, the connections are all being
> returned to the Pool. Therefore, user variables
> are accessed by different web users(All web users
> use the same MySql account 'ming').

Hey, that's interesting. I haven't thought of that. I guess that could be a problem after all when you use connection pooling.

If that is the case, how does this combine with transactions? Or would the connection pooling bit be smart enough to take care of that?

I'm a bit of an old-skool raw JDBC kinda user, so I know connection pooling is part of JDBC 3 (or 2 even?) but I've never used it.

>
> I haven't tested it without connection pooling.

By all means do! And please post back the result.
Please, also test what happens to a pending transaction.

> But as I have seen that it is really a matter to
> web applications when using connection pooling.
> Web user 'A' might get the result of web user 'B',
> and user 'B' might get errors as the result is
> being free, etc.
>
> Please prove that I'm wrong, I really want to
> continue using SP with MySql.

I guess, right now, your'e in a better position to prove it either way. I havent got the environment. sorry!


Anyway, it should not be a problem after all. You can easily make your procedures resilient. If you make sure you initialize the user variables each time before using them, there really should not be a problem here. Or is there?

I mean, even with connection pooling on, the separate pooled connections cannot see *each others* user variables.

Options: ReplyQuote


Subject
Views
Written By
Posted
2924
January 09, 2006 06:22AM
1584
January 09, 2006 08:06AM
1311
January 09, 2006 02:10PM
1889
January 09, 2006 08:02PM
1765
January 10, 2006 12:24AM
1581
January 10, 2006 03:07AM
1785
January 10, 2006 06:51AM
Re: Dynamic Sql Statement in SP
1490
January 10, 2006 01:49PM
1842
January 10, 2006 06:35PM
1640
January 10, 2006 07:22PM
1726
January 10, 2006 10:33PM
1735
January 11, 2006 03:10AM
2291
January 11, 2006 04:27AM
1726
January 11, 2006 06:54AM
1579
January 11, 2006 03:34PM
1753
January 11, 2006 03:56PM
1747
January 12, 2006 03:20AM
1533
January 12, 2006 04:44AM
1518
January 11, 2006 09:08PM
1754
January 12, 2006 03:11AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.