> Optimally, you should put it separatedly. Putting it in the Base class
> has no effect. This is for all java classes. There's no inherent
> performance gain in declaring this field explicitly. Not declaring it
> means either the compiler or the JVM(at class loading time) will
> calculate it for you.
>
> serialVersionUID won't have a preformance improvement in any of the app
> servers I use regulary. Your class is most likely to be extended by a
> wrapper class, which means the UID will be lost.

> As long as you don't use the same UID in 2 different classes you're
> alright.

Juan,

I found your answers to be quite helpful. Hopefully, you can addres my problem as
well.

We have a J2EE application running on JBoss with a remote Visual C++ GUI on
Windows as the front-end.
The GUI communicates with the J2EE application in two ways:

    1. Session EJBs.
    2. JMS messaging -
            both the GUI and the J2EE app subscribe to and send messages to
each other's topics

The client jars from the J2EE app are used by the GUI client build process
to generate C++ headers and implementation classes (using Jace/JNI).

So now the problem has to do with SerialVersionUID mismatch every time we
make a small change to the J2EE app.

The SerialVersionUID is auto-generated.

I'm not sure exactly how the mismatch occurs, but it seems to happen even when
I've not made a change in the interfaces and there's no Jace build involved.
Strangely enough, this problem sometiimes goes away upon restarting both the
client and app server - but not always, and when it persists, the only
solution is to do a complete rebuild of the GUI (starting with the Jace/JNI
build)- which takes hours!

(Of course, when we do have a change in the interface, it requires a
rebuild, and that's ok as it's expected).

I understand that the solution is to declare a cust
om serialVersionUID
constant in the code.
My questions are:
1. In which file should I declare the constant (a) for session EJBs? (b) for
JMS?
2. What's the best method to manage it's value? Since it's an explicit
constant in the code, I don't think I can change it in the build process
without manually modifying each source file that contains the
serialVersionUID- or can I?
3. Should I maintain a separate version for each file or just one value for
the current build version?

Your suggestions will be greatly appreciated.

Regards,
Murali Krishna Devarakonda


Regards,
Murali Krishna Devarakonda
mailto:[EMAIL PROTECTED]
http://www.EJBObject.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to