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

  • SEARCH
  • Home
  • 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 9173365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:34:22+00:00 2026-06-17T16:34:22+00:00

I have built an appender that writes Log4Net logs to a SimpleDB table/domain called

  • 0

I have built an appender that writes Log4Net logs to a SimpleDB table/domain called LogTable. I am now trying to write a windows service which will delete old records from this table. The AmazonSimpleDB client is definitely being created and the query when run manually does return records. However when the code is executed through a unit test no results are returned. The table and column name case sensitivity are correct.

using (AmazonSimpleDB simpleDbClient = AWSClientFactory.CreateAmazonSimpleDBClient(accessKey, secretKey))
                {
                    String selectExpression = String.Format("select * from LogTable where Timestamp < '{0:o}'", purgeDate);
                    SelectRequest selectRequestAction = new SelectRequest().WithSelectExpression(selectExpression);
                    SelectResponse selectResponse = simpleDbClient.Select(selectRequestAction);

                    if (selectResponse.IsSetSelectResult())
                    {
                        BatchDeleteAttributesRequest deleteRequest = new BatchDeleteAttributesRequest().WithDomainName("LogTable");
                        deleteRequest.Item = new List<DeleteableItem>();

                        SelectResult selectResult = selectResponse.SelectResult;
                        foreach (Item item in selectResult.Item)
                        {
                            deleteRequest.Item.Add(new DeleteableItem { ItemName = item.Name });
                        }

                        if (deleteRequest.Item.Count > 0)
                        {
                            simpleDbClient.BatchDeleteAttributes(deleteRequest);
                        }

                        logger.InfoFormat("Success - {0} log records deleted from LogTable", deleteRequest.Item.Count);
                    }
}

Would really appreciate some help on this one.

  • 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-06-17T16:34:23+00:00Added an answer on June 17, 2026 at 4:34 pm

    Only records that satisfy the expression will be returned so please make sure your query is correct. what does a simple select query return? Try this and check –

    select * from LogTable  
    

    If you are not getting any hits then please specify the region end point.

    and if it returns then please make sure the condition you have specified is getting matched.

    Edited :

    Please try to run this code and specify region end point using this link to which your domain belongs.

    AmazonSimpleDBConfig theConfig = new AmazonSimpleDBConfig();
    theConfig.ServiceURL = myEndpoint;  //where myEndPoint is the region endpoint you are interested in
    AmazonSimpleDBClient simpleDbClient= new AmazonSimpleDBClient(myKey, mySecretKey, theConfig);
    String selectExpression = "select * from LogTable";
    SelectRequest selectRequestAction = new SelectRequest();
    selectRequestAction.SelectExpression = selectExpression;
    selectRequestAction.NextToken = null;
    SelectResponse selectResponse = simpleDbClient.Select(selectRequestAction);
    SelectResult selectResult = selectResponse.SelectResult;
    List<Item> itemList = selectResult.Item;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a site which requires user to login. Now I have decided
I have built so far an application that allows the user to drag and
I have built a mock object using EasyMock, and I'm trying to have the
I have built the UI for my Google Chrome Extension, but I am trying
I have an NSIS installer script that I'm using to deploy a py2exe-built app
I have an InstallShield (InstallScript) installation, created using IS2009, that's built automatically every night,
Here's some easy reputation for someone. The scenario I have a table that is
I have this site that is built using the jQuery Masonry plugin, the site
I have built up an array of objects, created from a class, I wrote
I have built a local DVD Database using Codeigniter, With film names etc in.

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.