SQLWarngings from Sybase ASE

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SQLWarngings from Sybase ASE

cmathrusse
Hi Ludovic,

I'm experiencing some odd warnings bubbling up from the JConnect driver. I can't seem to locate documentation pertaining to them but they are of concern to me simply because of the content of the message.

java.sql.SQLWarning: 01S08: This connection has been enlisted in a Global Transaction. All pending statements on the current local Transactions(if any) have been rolled back.

This is followed by a stack trace.

I've attached the btm log file as well as the application log file. In the application log you can see the warning bubbling up which looks like an exception to me. But I'm uncertain if this is actually causing a rollback. I'm seeing some other odd behavior from Hibernate as well, but one thing at a time.

As always, thanks for the help..

QuoteServer.zip
Reply | Threaded
Open this post in threaded view
|

Re: SQLWarngings from Sybase ASE

Ludovic Orban
Administrator
Hi Chris,

I don't know exactly what is causing this warning but it seems to happen only when the connection is closed after the transaction has committed.


This is fortunately completely harmless: the warning just reminds you that any non-committed work you might have done will be rolled back when the XA transaction starts.

I can't really track where that happens but this seems to be indirectly due to the way Spring is configured in your case. Try to find what piece of your business logic is executing when that warning happens and trace back the code until you find why the connection is closed after the transaction is committed. That might not be easy, this could be due to Spring going a bit mad internally.


Ludovic
Reply | Threaded
Open this post in threaded view
|

Re: SQLWarngings from Sybase ASE

cmathrusse
That's less than encouraging. I'm working on a new project that I'm converting to Spring with BTM and of course I'm having a few issues. Most everything works great except I starting seeing this little warning that gave me reason for concern.

The other issue I'm seeing has something to do with Hibernate.

identifier of an instance of com.sybase.it.quoting.beans.Customer was altered from 414 to 413; nested exception is org.hibernate.HibernateException: identifier of an instance of com.sybase.it.quoting.beans.Customer was altered from 414 to 413


I'm reasonably certain that this has nothing to do with the transaction. Documentation pertaining to this exception is scattered all about the internet but ever situation seems to be unique. (Damn hard to nail down)

On the upside though, BTM is working remarkably well with this project and my application in production.

Thanks for taking a look at this. I'll keep you posted as to what I find.
Reply | Threaded
Open this post in threaded view
|

Re: SQLWarngings from Sybase ASE

Ludovic Orban
Administrator
Chris,

The SQLWarning error you're getting seems to be related to the way the TM is used, not to what it is doing itself.

That HibernateException rings a bell, I might have run into it some time ago. From what I remember, Hibernate throws it when you load a bean from the DB then try to modify the property marked as primary key then try to commit the transaction. Hibernate considers the PK immutable and complains when you try to change it. I might be wrong of course.

Once again this problem seems to be totally outside BTM's scope.

Ludovic
Reply | Threaded
Open this post in threaded view
|

Re: SQLWarngings from Sybase ASE

cmathrusse
You are correct. That was what I got out of the exception message as well. However, there is no modification of the pk field transpiring. I've seen other message post out there related to this exception that can be caused from things as incorrect data type mappings between the java class and the hibernate mapping file, but that didn't pan out either.

The real challenge with the hibernate exception is that the the code is only attempting to locate a customer and assign it to a quote as the licensee. Consistently the exception is thrown from this method. Now the interesting part is that the code is exactly the same code that assigns a customer to the quote, the only difference is that this one simply assigns the customer to the quote as a licensee instead. (Damn hard to nail down) Perhaps its something to do with the quote....

I'm also fighting with the deployment onto EAServer. (What a surprise) The application deploys perfectly on Tomcat and Glassfish. I wish I could make others understand the value of a good app server.

Thanks once again for the help...