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

Ask A Question

Stats

  • Questions 176k
  • Answers 176k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use appendChild method : var newDiv = document.createElement('div');… May 12, 2026 at 3:14 pm
  • Editorial Team
    Editorial Team added an answer If you specify src/main/filters as a resources location, Maven will… May 12, 2026 at 3:14 pm
  • Editorial Team
    Editorial Team added an answer If you're just posting data back to the same script… May 12, 2026 at 3:14 pm

Related Questions

I joined a new company about a month ago. The company is rather small
First a bit about the environment: We use a program called Clearview to manage
I am currently working on an application which references the Microsoft Business Contact Manager
I am currently trying to create a menu system for a game and cannot
I am relatively new to Xcode and one thing that has bothered me is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.