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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:54:23+00:00 2026-06-09T00:54:23+00:00

I have a custom Data Source, let’s call it SQSDatasource . It’s working fine,

  • 0

I have a custom Data Source, let’s call it SQSDatasource. It’s working fine, generally, for find(), save(), and even delete().

class SQSDatasource extends DataSource {
    public function delete(Model $Model, $conditions = null) {

        // Deliberate break point to ensure that this function is being called
        print_r($conditions);
        exit();

        // I have my proper delete logic here, which works fine usually
    }
}

A Model, say Job that uses the SQSDatasource. There is no extraordinary logic in Job.

I am encountering a strange anomaly, however.

class TestShell extends AppShell {
    public $uses = array('Job');

    public function main() {
        // This works fine.
        $job = $this->Job->find('first');

        // The break point never gets called
        $this->Job->delete('TEST!');

        // This gets called
        $this->out('This gets called.');
    }
}

However, if I remove $this->Job->find() before calling $this->Job->delete(), it works perfectly fine. delete() would get called.

Anyone has any clue on this anomaly?

  • 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-09T00:54:24+00:00Added an answer on June 9, 2026 at 12:54 am

    I’ve managed to find out where the problem lies. My datasource code is actually complete with full implementation of read(), create(), etc. And all the standard CakePHP CRUD functions work fine with my datasource.

    The problem I had is mainly due to these reasons:

    1. delete() in CakePHP actually does a find('count') internally before allowing the delete, which I was not expecting

    2. The behavior of amazon-sqs. When a message is in-flight, it is temporarily invisible.

    3. Also, for amazon-sqs, you cannot delete a message without first querying it (as delete is done not via message ID, but via message handler). And once you start querying it, it becomes temporarily invisible, which results to CakePHP thinking that the delete is invalid.

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

Sidebar

Related Questions

I have a slow custom data source in a SSIS Dataa Flow Task.I have
We have a custom data source that extends BasicDataSource. We have overridden the getConnection
I have a custom NSTableView subclass which is bound to a data source (an
How do i select elements that have my custom data attribute data-validate with jQuery
I have assigned a custom data attribute to some circles added to the Raphael
I have mastered creating custom data types and adding fields with CCK. Then I
I am trying to have a tree display custom data that looks like this.
The task: I am trying to create a custom data type and have it
I have a custom list view that is getting data from server and changing
I have a custom image file where the first block of data is ASCII

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.