Subject Re: [Firebird-Java] Re: java.io.NotSerializableException
Author Juan Pedro López Sáez
Hi,

> Why do you store connections in http sessions? Do you expect that on
> serialization it will close the connection, and after de-serializing
> it will restore connection to the database from the point when it
> disconnected?
>
> In general, it is a very bad idea to store connection in the session.
> In particular, you cannot serialize session, since java.sql.Connection
> is not serializable.

I have embedded my Connection Objet inside a session scope Bean in my
web application. This is done just to use the same connection along the
complete http session.

The fact is everything seems to be working fine but when I get the
NotSerializableException. As I said, that's very unusual.

Should I change my code design to avoid embedding a Connection objet in
a session scope Bean? Is every session scope bean serialized during a
http session? Knowing that java.sql.Connection is not serializable, why
my application seems to works fine most of the time?

What's the best choice to use the same connection in a http session?

Thank you


> Yahoo! Groups Sponsor
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.