From: Sonnek, R. <Rya...@bp...> - 2003-04-23 19:06:14
|
Sorry dave, I didn't want to come off like "YOUR CODE IS WRONG!" =) The project I'm working on wasn't exactly 'easy' to change over, but it certainly wasn't impossible. Depending on the size of your system this could be more or less difficult, but I'd have to agree that this would be a more optimal way to do database connections. As far as I know, previous versions of jboss handled pooled connections the same way as 3.0.7, just without the warning messages, so I think that it's valid to say that going 'back to the 3.0.6' way isn't going to get you anything (except no messages). I don't know if there are any changes to how these nested queries are handled in 3.2 or 3.0.8. do you? Ryan -----Original Message----- From: David Ward [mailto:da...@do...] Sent: Wednesday, April 23, 2003 1:58 PM To: jbo...@li... Subject: RE: [JBoss-user] 3.0.6 vs. 3.0.7 wrapped connections question Ryan, Quote: "Just change your code..." Unfortunately it's not that easy for us at the current point of our development cycle. :( Thanks for your input though, David Mensaje citado por "Sonnek, Ryan" <Rya...@bp...>: > David (ward), > Quote: > I debug <<OPEN>> and <<CLOSE>> whenever I use a connection, and they match > up. The problem is that sometimes I have to do <<OPEN:1>> <<OPEN:2>> > <<CLOSE:2>> <<CLOSE:1>>, which is confusing the ConnectionManager. > > This is exactly what I meant when I was talking about 'Nested Queries'. I > was able to easily change my code to stop this from happening and now I've > got no warning messages coming from jboss. Just change your code to make > the second connection AFTER the first one is closed. If you need to save a > foreign key from the first query to make your second query, save it in a > local variable, and use it after the connection is closed. > > -----Original Message----- > From: David Ward [mailto:da...@do...] > Sent: Wednesday, April 23, 2003 11:56 AM > To: jbo...@li... > Subject: Re: [JBoss-user] 3.0.6 vs. 3.0.7 wrapped connections question > > Setting specCompliant to true did not work. I still get lines like this: > > 2003-04-23 12:37:55,433 INFO > [LocalTxConnectionManager$LocalConnectionEventListener] throwable from > unregister connection > java.lang.IllegalStateException: Trying to return an unknown connection2! > org.jboss.resource.adapter.jdbc.WrappedConnection@a28815 > at > org.jboss.resource.connectionmanager.CachedConnectionManager.unregisterConne > ction(CachedConnectionManager.java:274) > at > org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectio > nEventListener.connectionClosed(LocalTxConnectionManager.java:371) > at > org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.closeHandle(Bas > eWrapperManagedConnection.java:280) > at > org.jboss.resource.adapter.jdbc.WrappedConnection.close(WrappedConnection.ja > va:97) > > and now I also get lines like this: > > 2003-04-23 12:37:56,098 INFO > [LocalTxConnectionManager$LocalConnectionEventListener] Unregistered handle > that > was not registered! > org.jboss.resource.adapter.jdbc.WrappedConnection@16e9494 > for managedConnection: > org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19811ce > > I have quadruple-checked that I always have a close for my opens. I debug > <<OPEN>> and <<CLOSE>> whenever I use a connection, and they match up. The > problem is that sometimes I have to do <<OPEN:1>> <<OPEN:2>> <<CLOSE:2>> > <<CLOSE:1>>, which is confusing the ConnectionManager. > > Did you get the fix in to the 3.0 branch, such that if/when 3.0.8 gets > released > it will be there? If not, I'm thinking we might have to upgrade to 3.2. > > The only problem is that it's somewhat scary for us to use a .0 release > (3.2.0), > even though I know it went through beta testing and several release > candidates. > Anyone have any idea when 3.2.1 is expected (not that I need anything in > it...)? > > Thanks yet again, David J. > David W. > > > Mensaje citado por David Jencks <dav...@ad...>: > > > On 2003.04.22 13:16 David Ward wrote: > > > David (Jenks), > > > > > > Continued thanks. That prompts me to ask 2 more questions, though (are > > > you sick > > > of me yet? ;) ): > > > > > > 1) Do you know if there will be a JBoss 3.0.8 that will have the fix? > We > > > need > > > 3.0.7 (it has a security enhancement over 3.0.6 we require), but aren't > > > ready to > > > move to 3.2. > > > > presumably eventually, but I have no idea when-- probably after there > have > > been enough bug fixes. You can lobby with Scott if you want:-) > > > > > > 2) I thought I remembered seeing something on this list where through a > > > configuration option I could turn off the new functionality of jboss > code > > > checking/closing connections for app code. Is this true? If so, how? > > > > > In the CachedConnectionManager mbean set the attribute SpecCompliant to > > true. > > > > david jencks > > > > > > > Thanks again, > > > David (Ward) > > > > > > > > > Mensaje citado por David Jencks <dav...@ad...>: > > > > > > > Unfortunately I didn't get the fix for this into 3.0.7. 3.0 cvs and > > > 3.2 > > > > don't have this bug. I think, as Ryan indicates, that making sure > you > > > only > > > > have one connection handle open at a time (per > > > > thread/transaction/datasource) will work around this. > > > > > > > > david jencks > > > > > > > > On 2003.04.21 10:58 David Ward wrote: > > > > > Thanks for your quick response, David. Here's a related question, > > > > > though: > > > > > > > > > > Sometimes in the log, we see this: > > > > > > > > > > 2003-04-21 10:07:55,242 INFO > > > > > [LocalTxConnectionManager$LocalConnectionEventListener] throwable > > > from > > > > > unregister connection > > > > > java.lang.IllegalStateException: Trying to return an unknown > > > connection2! > > > > > org.jboss.resource.adapter.jdbc.WrappedConnection@99ea5d > > > > > at > > > > > > > > > > > > > > > org.jboss.resource.connectionmanager.CachedConnectionManager.unregisterConne > ction(CachedConnectionManager.java:274) > > > > > at > > > > > > > > > > > > > > > org.jboss.resource.connectionmanager.LocalTxConnectionManager$LocalConnectio > nEventListener.connectionClosed(LocalTxConnectionManager.java:371) > > > > > at > > > > > > > > > > > > > > > org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.closeHandle(Bas > eWrapperManagedConnection.java:280) > > > > > at > > > > > > > > > > > > org.jboss.resource.adapter.jdbc.WrappedConnection.close(WrappedConnection.ja > va:97) > > > > > > > > > > > > > > > It comes from a place in our code that gets executed from (not > > > directly > > > > > inside) > > > > > a TX=Required SLSB. It is in a place where unfortunately (due to > > > API) we > > > > > can't > > > > > share the same Connection we're using everywhere else, so in that > > > code we > > > > > have > > > > > to re-lookup the DataSource, use a Connection and close it. > However, > > > I > > > > > think > > > > > what's going on is that maybe the ConnectionManager is having > trouble > > > > > keeping > > > > > track of more than one Connection being used within a single local > > > TX? > > > > > And > > > > > maybe since closing (returning to DataSource) that second > Connection > > > > > confuses it > > > > > as it wasn't the first Connection taken from the DataSource? > Later, > > > > > we're > > > > > seeing another stack trace saying "close it yourself." But I'm > > > thinking > > > > > because > > > > > of this past problem, it lost track of the original Connection that > > > I'm > > > > > then > > > > > trying to close? > > > > > > > > > > I probably didn't say that too well so if it doesn't make sense I > can > > > try > > > > > it > > > > > again... ;) > > > > > > > > > > Thanks, > > > > > David > > > > > > > > > > > > > > > > > > > > Mensaje citado por David Jencks <dav...@ad...>: > > > > > > > > > > > On 2003.04.21 08:42 David Ward wrote: > > > > > > > In JBoss 3.0.7, we've seen some INFO stack traces saying that > > > JBoss > > > > > is > > > > > > > closing a > > > > > > > connection for us, "please do it yourself." We've found some > > > places > > > > > > > where we > > > > > > > forgot to close and have closed them, and others we are still > > > > > tracking > > > > > > > down. > > > > > > > > > > > > > > However, in 3.0.6, we never saw the INFO stack traces. Does > this > > > > > mean > > > > > > > that > > > > > > > JBoss was not closing stuff for us, > > > > > > > > > > > > yes. The "closing connection for you" is new with 3.0.7 (also > > > present > > > > > in > > > > > > current 3.2 and 4). > > > > > > > > > > > > or it was but was just being quiet > > > > > > > about it? > > > > > > > > > > > > no such luck. > > > > > > > > > > > > david jencks > > > > > > > We would like to know so we can determine if we should hold up > a > > > > > release > > > > > > > of our > > > > > > > software that was going to be put onto 3.0.6. > > > > > > > > > > > > > > Thanks, > > > > > > > David > > > > > > > > > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > JBo...@li... > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > JBoss-user mailing list > JBo...@li... > https://lists.sourceforge.net/lists/listinfo/jboss-user > --------------------- David Ward da...@do... http://www.dotech.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list JBo...@li... https://lists.sourceforge.net/lists/listinfo/jboss-user |