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 7665159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:29:26+00:00 2026-05-31T14:29:26+00:00

I have a java web application that I removed a function from the code

  • 0

I have a java web application that I removed a function from the code and yet the database entries that this function writes are still being written to the database.

Inside the IssueWarrant function there is a call to insertWarrantFee that has been commented out.

private void issueWarrant(String CasePrefix, String CaseNumber, String HearingType, String Suspend)
    {
        int i = 0, intDivision = 0, pos = 0;
        String SummSeq = getSummSeq(CasePrefix, CaseNumber);
        String Charges = getCharges(CasePrefix, CaseNumber, HearingType);
        boolean isVacated = false, isHearingFound = false;
        NextBWNumber warrNbr = new NextBWNumber();
        String WarrantNumber = warrNbr.getNextBWNumber();
        String warrStatus = warrNbr.getNextBWNStatus();
        String HearingDesc = "", Division = "";
        isVacated = getVacatedStatus(CasePrefix, CaseNumber, HearingType);
        isHearingFound = getHearingStatus (CasePrefix, CaseNumber, HearingType);

        HearingDesc = getFormatToday() + "  " + getHearingDesc(HearingType);
        if (HearingDesc.length() > 30)
        {
            HearingDesc = HearingDesc.substring(0,30);
        }
        Division = getHearingJudge(CasePrefix,CaseNumber,HearingType);
        intDivision = Integer.parseInt(Division);
        if (intDivision < 10)
        { Division = "0" + Division; }

        Statement localstmt = null;
        String localqueryString;

        localqueryString = "INSERT INTO " + library7 + "CMPBWPND" +
            " (CASPRE, CASNUM, DEFSEQ, CHGSEQ, SUMSEQ, STSCOD, STSDAT," +
            " STATUT, CHGABV, BWNBR, JUDCOD, PRVFLG, CT2FLG, DIVISN, BNDAMT," +
            " BTYPE, CMNT, CUSER, TUSER, LUPDAT, SCRDAT, STATSDAT, SUMCRDAT, LUPDATE )" +
            " VALUES ('" + CasePrefix + "', " + CaseNumber + ", 1, " + Charges.substring(i, i + 1) +
            ", " + SummSeq + ", 9, " + getShortDate() + ", 'RCP 12-A TA', 'WARRANT', '" +
            WarrantNumber + "', " + intDivision + ", 'N', 1, '" + Division + "', " +
            BondAmt + ", '" + BondType +  "', '" + HearingDesc + "', 'TAAD', 'TAAD', " +
            getShortDate() + ", " + getShortDate() + ", " + getLongDate() + ", " + getLongDate() +
            ", " + getLongDate() + ")"; 

        try
        {
            if (!isVacated && isHearingFound)
            {
                localstmt = conn.createStatement();
                localstmt.executeUpdate(localqueryString);
                localstmt.close();
                StatusMsg = "Client No Show-WI";
            }
            if (isVacated)
            {
                StatusMsg = "Client Vacated Case";
            }
            if (!isHearingFound)
            {
                StatusMsg = "Client Hearing Missing";
            }

        } catch (SQLException e)
            {
                System.out.println("IssueWarr - Error in IssueWarrant");
                e.printStackTrace();
                ReturnInfo = "Issuing Warrants Failed.";
                success = false;
            }finally
            {
                try
                {
                    if (!localstmt.isClosed())
                    {
                        localstmt.close();
                    }                   
                } catch (SQLException sql2)
                    {
                        System.out.println("Error trying to close connections. Exception: " +  sql2.getMessage());
                    }
            }

        **//insertWarrantFee(CasePrefix, CaseNumber, SummSeq, WarrantNumber);**     
        updateHearingRecord(CasePrefix, CaseNumber, HearingType, Charges.substring(i, i + 1), Suspend);

        for ( i = 1; i < Charges.length(); i++ )
        {
            insertBWPTFRecord(CasePrefix, CaseNumber, SummSeq, Charges.substring(i, i + 1));
        }
        if (!success)
        {
            StatusMsg = "Client Iss. Warrant Failure";
        }
    }

Here is the code that the insertWarrantFee called before it was commented out:

private void insertWarrantFee(String CasePrefix, String CaseNumber, String SummSeq, String WarrantNumber)
    {
        Statement localstmt = null;
        String localqueryString;
        ResultSet localrSet = null;
        String feeAmt = null;

        localqueryString = "SELECT AUTO$$ FROM " + library3 + "CMPDKTTP WHERE DKTTYP = 'W'";
        try
        {
            localstmt = conn.createStatement();
            localrSet = localstmt.executeQuery(localqueryString);         
            while (localrSet.next())
            {
                feeAmt = localrSet.getString("AUTO$$");
            }
            localstmt.close();
            localrSet.close();

        } catch (SQLException e)
            {
                System.out.println("IssueWarr - Error in Insert Warrant Fee SQL1");
                e.printStackTrace();
                ReturnInfo = "Issuing Warrants Failed.";
                success = false;
            }finally
            {
                try
                {
                    if (!localstmt.isClosed())
                    {
                        localstmt.close();
                    }                   
                } catch (SQLException sql2)
                    {
                        System.out.println("Error trying to close connections. Exception: " +  sql2.getMessage());
                    }
            }   

        localqueryString = "INSERT INTO " + library7 + "CMPBWTRN"
            + " (CASPRE, CASNUM, DEFSEQ, SUMSEQ, BWNBR, FEEAMT, DKTTYP, TUSER, LUPDAT)" 
            + " VALUES ('" + CasePrefix + "', " + CaseNumber + ", 1, " + SummSeq + ", '" + WarrantNumber
            + "', " + feeAmt + ", 'W', 'TAAD', " + getShortDate() + ")";                
        try
        {
            localstmt = conn.createStatement();
            localstmt.executeUpdate(localqueryString);
            localstmt.close();

        } catch (SQLException e)
            {
                System.out.println("IssueWarr - Insert Warrant Fee SQL2");
                e.printStackTrace();
                ReturnInfo = "Issuing Warrants Failed.";
                success = false;
            }finally
            {
                try
                {
                    if (!localstmt.isClosed())
                    {
                        localstmt.close();
                    }                   
                } catch (SQLException sql2)
                    {
                        System.out.println("Error trying to close connections. Exception: " +  sql2.getMessage());
                    }
            }
    }

So even though the line that called insertWarrantFee is commented out a record is still being inserted into CMPBWTRN.

Any ideas how this could happen? The developer is indicating it could be a tomcat connection cache issue? Any other suggestion beside magical code?

Thanks!
Leslie

  • 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-31T14:29:27+00:00Added an answer on May 31, 2026 at 2:29 pm

    A couple of things to try:

    • Make sure you’ve redeployed the application and have restarted Tomcat. Check the timestamp of the deployed class in question.
    • Clean Tomcat’s tmp and work directories
    • Open the deployed Java class using a decompiler to see whether the removed code is still in there.
    • Add a logging (or System.out.println) statement to the method that’s commented out, and to the method calling it. See whether one or both are printed after redeploying the changes.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java application (non-web) which must read from a properties file. This
I have a java web application that I'm running with tomcat. This application has
I have a Java Web Start Application that I launch from live site by
I have a java enum that is used in my web application. I also
I have built a web application using Java EE platform that sells one of
I have a java web application that generates and displays graphical pictures based upon
I have a web application that downloads a jar file from the web server
I have a Java web application that uses a plugin architecture. I would like
I have a Java Web application that has several servlets with the following mappings.
I have a Java EE web application that does not make use of EJBs.

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.