Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 372723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:14:18+00:00 2026-05-12T14:14:18+00:00

I am currently working on one messy web application. In this application, there is

  • 0

I am currently working on one messy web application. In this application, there is a class that holds all the data sources. And whenever the need to connect to a specific data source, the method in the instance of the class is called with a parameter to select the data source.And class is like follows

   public class MyConnection implements Runnable,DbConnection, Serializable
   { 
       private static final long serialVersionUID=2007L;
       public static transient DataSource FirstDatasource;
       public static transient DataSource SecondDatasource;
           BaseDbConnection _bidc;
           ....

And on each page, this object is to get and set to the session(I don’t know why like this). And it works fine with the current setup. (clustering, load balancing etc..)

But my work is to implement fail-over, and when I enable session replication(in memory – simple TCP), writing the session is failing and its throwing the following exception

 org.apache.catalina.ha.session.DeltaManager requestCompleted
 SEVERE: Unable to serialize delta request for sessionid [FE02AF01C76F41D042FE04692462D983.tomcat1]
 java.io.NotSerializableException: org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper
 at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
 at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
 .....

Since there are more than "I can count" no of pages, it’s not easy to replace the code which sets the connection object in session from each and every page. And the complete app is based on this connection object(Datasources also play an important role).

Is there a way I can change this class so that it can be persisted in session?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:14:18+00:00Added an answer on May 12, 2026 at 2:14 pm

    If I understood correctly, I would say that replicating a DataSource is not correct, it can not work.

    What need to be done is, after deserialing, to get a new (local) DataSource that corresponds to the need, and set it in the field. It is possible that this happens already in your code, look for a readResolve method.

    If some parameters are needed to know which DataSource, they can be serialized themselves (because they are no DataSource, they could be just Strings for example).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are currently working on a new version of our main application. one thing
In the application I'm working on porting to the web, we currently dynamically access
i am currently working on one project. In my project there are many entity/POJO
I am currently working on code that serializes in one app (C++) and needs
I am currently working with 2 sql 2000 servers one I can query but
I am currently working in a project with developers working on three sites. One
I'm currently working through the excercises in 'The C Programming Language'. Here's one of
I'm currently working on creating a new C# project that needs to interact with
I'm currently working at a small web development company, we mostly do campaign sites
I am currently working on an application which references the Microsoft Business Contact Manager

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.