api,entity,breeze , breeze.js not honoring the “noTracking” option when end point returns multiple result sets

breeze.js not honoring the “noTracking” option when end point returns multiple result sets


Tag: api,entity,breeze

Consider this breze query:

return EntityQuery.from('myAPI')

My API is defined like this:

public object myAPI()
      // var userId = get the users id from auth ticket
      var userPref = _contextProvider.Context.UserPreferences.Where(u => u.userId == userId);
      var userOptions = _contextProvider.Context.UserOptions.Where(u => u.userId == userId);
      return new

I know I can get access to the raw data, which is great. But in addition to this, the entities are created in the entity manager, which I would prefer they not be. This works fine for apis that return IQueryable. Is there a different syntax for noTracking for web apis that returns multiple result sets?



I can't reproduce the error you describe. I have a similar DocCode test that passes which references Breeze v1.5.3.

Here is the pertinent NorthwindController method:

    public object Lookups()
        var regions = _repository.Regions;
        var territories = _repository.Territories;
        var categories = _repository.Categories;

        var lookups = new { regions, territories, categories };
        return lookups;

And here's the passing QUnit test:

  asyncTest('object query (e.g., lookups) w/ "no tracking" does not add to cache', function () {
    var em = newNorthwindEm();

    function success(data) {
      var lookups = data.results[0];
      var hasLookups = lookups &&
                       lookups.categories && lookups.regions && lookups.territories;
      ok(hasLookups, 'Expected a lookups object w/ categories, regions and territories');

      var cached = em.getEntities();
      var len = cached.length;
      equal(0, len, 'Expected ZERO cached entities of any kind and got ' + len);

If I comment out the noTracking(true) clause, the test fails and tells me that there are 65 entities in cache ... as predicted.

What am I missing?


Give port number and passed parameters in WSO2

I am trying to learn WSO2 but have been stuck at a minor step which i believe should be quite easy to do. While creating a new api i need to give the production endpoint. What i want to give is the url along with the port as well. So...

Is there any way to find out when an album got added to spotify with the web api?

My usecase is to present the latest added album of an artist (regardless of releasedate). I use the https://api.spotify.com/v1/artists/[artistId]/albums to get the albums but I can't find any information about how the response is ordered. Is it random or actually sorted by the date the album got added to spotify?...

Google Webmaster API - Mark crawlerros as fixed

While marking the crawl-errors as fixed via the API, I got an 403 error „Insufficient Permission“. If I only read the erros via the api, I got no errors. I’m the owner of the site and I logged with my google webmaster credentials. I've created the API creditals with the...

Apache Nutch REST api

I'm trying to launch a crawl via the rest api. A crawl starts with injecting urls. Using a chrome developer tool "Advanced Rest Client" I'm trying to build this POST payload up but the response I get is a 400 Bad Request. POST - http://localhost:8081/job/create Payload { "crawl-id":"crawl-01", "type":"INJECT", "config-id":"default",...

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 4: ordinal not in range(128)

i have taken this code from https://github.com/davidadamojr/TextRank and i am facing this problem. i tried to solve by placing utf-8 in "keyphrases = decode('utf-8').extractKeyphrases(text)" but failed. here is the code: """ From this paper: http://acl.ldc.upenn.edu/acl2004/emnlp/pdf/Mihalcea.pdf External dependencies: nltk, numpy, networkx Based on https://gist.github.com/voidfiles/1646117 """ import nltk import itertools from operator...

How to make the Twitter API returns me over 800 tweets

How to make the Twitter API (home_timeline) returns me over 800 tweets? For example applications like tweetbot how do it to have more updates in the 3000 home timeline? I think that using a cache system but which one?

Retrieving values from a php service in HTML

I am trying to build a website that displays a google map with a user location (lat/long) from a php service that I wrote. I already have a php script that gets the lat/long from a mobile app (via POST from the client), stores it in a DB, and read...

Return value -Java API design VS. C API

I used C a lot before and now use Java. I have a question of API design in JAVA. In C, I always use int as a meaningful return value, and put multiple objects(some of which will be changed) in arguments. e.g, int foo(int x, int y, int *result) {...

Using Graph API Explorer gets friends list but my own app doesn't . (Graph API Explorer token v.s App Token)

I am trying to get my friends list in my app. If I use the access token in my Graph API Explorer console and hit the url. https://graph.facebook.com/v2.3/me?access_token='GraphAPIToken'. I am able to get the complete friends list. If I try using the SDK or any library like fbgraph for nodejs...

Ruby on Rails posting to an API using javascript via a proxy

I'm very new to Ruby on Rails and I'm hoping this will be a quick fix. I have a very simple form (firstname, surname, email) that needs to post XML to an API on another domain. Everything on our site is clientside javascript so I would like to post to...

Retrieve access token for Yahoo API using OAuth 2.0 and Python requests

I am trying to retrieve the access token for the Yahoo API, using the explicit grant flow as described in this document: https://developer.yahoo.com/oauth2/guide/flows_authcode Everything is fine until Step 4: Exchange authorization code for Access Token I wrote the following python script to retrieve the code: import urllib2 import requests import...

How to compare voice command input by user to hard coded strings

I am currently working on an app that takes user input by voice command. The program recognizes the words using the google api. I want to be able to compare the user voice input to hard coded strings. My problem is that I do not know how to code this...

REST-API Different Content-Type on Error Response

Since some weeks I'm working on an rest api using spring-mvc. The REST-API is working properly and I`m almost done until one last problem when it comes to error handling with specific error-objects. The REST-API is using JSON as format to serialize Java-Objects. When an error occurs during service-execution an...

Django update without required fields

I'm trying to execute an update through my API. When I push an update, I do not have all the required fields, because I'm only trying to update the ones that have changed. I get a 400 "This field is required." error. I know the field is required, but I'm...

Dismiss Windows Phone alarm

Is there an API for the regular alarm/reminder that can be used to dismiss it programatically? I have tried looking in the MSDN library for a code sample, but didn't have luck.

Link to another resource in a REST API: by its ID, or by its URL?

I am creating some APIs using apiary, so the language used is JSON. Let's assume I need to represent this resource: { "id" : 9, "name" : "test", "customer_id" : 12, "user_id" : 1, "store_id" : 3, "notes" : "Lorem ipsum example long text" } Is it correct to refer...

REST api : correctly ask for an action

I'm currently working on a REST api. I've read a few times how to handle endpoints the right way, using the protocol (post, put, ...) to define which action should be made. Let's say I have a list of quotes. I have : a GET endpoint /quotes that let me...

square connect api batch processing

I need assistance with batch processing, especially in adding tax codes to items. I'm experimenting with the square batch processing feature and my sample cases are create 2 items and add the tax code to them. In all 4 requests - 2 for creating item, 2 to 'put' the tax...

Multiple behaviours for single entity

I wrote a VHDL Testbench which contains the following : Lots of signal declarations UUT instantiations / port maps A huge amount of one-line concurrent assignments Various small processes One main (big) process which actually stimulates the UUT. Everything is fine except the fact that I want to have two...

REST API with token based authentication

I want to develop a web site with AngularJS. On the backend side I will use Codeigniter REST framework. I have some security issues and I don't want to start developing without fixing them on my mind. I don't want to use something like api key because it will be...

API Integration

Im new here and Im not a programmer but learning along the way. I have come up against a problem but in your explanation (if any - thanks) dont presume that I know. Hope you can help me solve this. Here are the details: Im trying to integrate Interpire EmailMarketer...

Doctrine OneByOne's and Date

I am using Symfony 2.7.1 and I seem to have a problem while using my News Entity. I am trying to use the published_at in my twig template. I tried using {{ news_item.published_at|date("m/d/Y") }} but that seems to follow up by a fatal error: Method "published_at" for object "AppBundle\Entity\News" does...

How to POST - API in thingspeak.comusing urllib in Python

I am working on a project where I have to get data from a website and then post it to a different website. At the moment I am still new, so I am using a thingspeak.com account to experiment on posting, and I am also following the same example used...

GitHub API returned Url meaning

Take this very simple API as example, https://api.github.com/users/zhuhuihuihui In the JSON formatted response, you'll find something like following, "following_url":"https://api.github.com/users/zhuhuihuihui/following{/other_user}", "gists_url": "https://api.github.com/users/zhuhuihuihui/gists{/gist_id}", "starred_url": "https://api.github.com/users/zhuhuihuihui/starred{/owner}{/repo}", Ok, I know like the following_url, starred_url is something like a sub API which you can call to fetch who that user are following, or what repos...

Hide referrer header in API request

I need to make requests to Google Translate Text-To-Speech API. I have an enabled key but keep getting blocked by No Access-Control-Allow-Origin. I've posted more about it here: Google Translate API - No Access Control Origin with Text to Speech The following sources, http://weston.ruter.net/2009/12/12/google-tts/ and Request to Google Text-To-Speech API...

CORS, Client vs. Server & Rails API GET Request

I've built a GET Rails API that checks for an access token and that the registered request.env["HTTP_X_REAL_IP"] matches the IP address that is registered within the admin panel of the app. Example request: https://staging.mysite.com/api/v1/products?access_token=7b9f3cddd3914a6f45fa692997fe6dc9 The API works great when I'm making requests from a server by curling the request or...

Blockchain receive API with same address

I need to accept bitcoins on my website (PHP). I'm using blockchain and i have read the api: https://blockchain.info/api/api_receive Is quite simple but i have some questions, but first i will try to explain what i need. Client send bitcoins to my wallet (Any amount they want) Server will be...

Symfony2 Catchable Fatal Error: Argument 1 passed to entity Catchable Fatal Error: Argument 1 passed to entity

I got this error and I'm stuck since many hours Catchable Fatal Error: Argument 1 passed to Thinking\ThinkBundle\Entity\InYourMind::setThinkFriend() must be an instance of Thinking\ThinkBundle\Entity\InYourMindFriend, array given, called in /var/www/html/thinkroulette/vars/vendor/symfony/symfony/src/Symfony/Component/PropertyAccess/PropertyAccessor.php on line 410 and defined I searched for this issue and lots of results came up but I wasn't capable to...

Why JPA entities are treated like this outside a session?

Hy, I am having a "Solve failed to lazily initialize a collection of role.... exception" in jpa. I understand that outside a session, when you want to retrieve a lazy collection if there is not session bound you will get this error, fine. But what I dont understand is if...

Symfony 2 - Class “Mingle\StandardBundle\Entity\Product” is not a valid entity or mapped superclass

I created a Product.php file in my bundle Mingle\StandardBundle\Entity like this: <?php namespace Mingle\StandardBundle\Entity; use Doctrine\ORM\Mapping as ORM; /* * @ORM\Entity * @ORM\Table(name="product") */ class Product { /* * @ORM\Column(type="integer") * @ORM\ID * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /* * @ORM\Column(type="string",length=100) */ protected $name; /* * @ORM\Column(type="decimal",scale=2) */ protected $price; /*...

How to get each track of a playlist with the Soundcloud API?

I am working with the Soundcloud API to create a custom playlist (another look than the original Soundcloud player). See image below. I am develop a website for an artist. With the API of Soundcloud I want to import his music from Soundcloud to the website. There are different tabs...

Removing Alert When Using DeleteFile API

I'm writing a VBA application which involves looping a large number of directories recursively. I am using the FindFirstFile API to to achieve this, as it offers a substantial performance boost over the FileSystemObject. In order to remove the FSO from my code entirely, I need a routine to delete...

Ruby API Call Page Issue

This might be a basic issue but very common so it might be helpful to other people in the future. I use HTTParty to make a get request to an API, which returns some information, something like this: { datapath: "blah-blah.blah.blah", success: true, info: { row_limit: 500, total_results: 2700, total_pages:...

Spotify Web API - Client Credentials - Accessing a users playlists

I'm trying to access users playlist tracks by using the client credentials flow. Spotify getting playlist documentation: https://developer.spotify.com/web-api/get-playlists-tracks/ Spotify getting client credentials documentation: https://developer.spotify.com/web-api/authorization-guide/ First question, is it possible to get a users playlist tracks using client credentials flow? I'm using this flow since I'm unable to pop up a...

PHPUnit: Testing RestFul API with die response

I am trying to PHPUnit test an action in my ZF2 project. The APIs return a JSON string using die($jsonObject). This causes the PHPUnit test to stop processing and just die a JSON response. public function testStartupAction() { $this->dispatch('/api/v3/startup', "POST", array()); $this->assertJson('{"status":false,"message":"Please enter the UID","data":null}'); } assetJson method is never...

Use higher API level in android with an external library

Would it be possible to import an external library (.jar file) in an android project containing the features of API level 21, and then use them in my application with a minimum sdk version set to say like 17? I'm really into Matierial Design but as Google states, "To use...

PayPal Developer Account & API ..what happens if account is limited?

I have a hypothetical question about my PayPal developer account. Since the app I developed uses an API Username (myname-facilitator_api1.mydomain.com), API Password and API Signature to do the transactions, I am wondering what happens with the API access if my PayPal account for whatever reason becomes limited? I've had my...

xmlrpclib error 'module not found' when trying to access gandi api

I am trying to set the DS record in the gandi api as describded in the gandi api support doc It states to 'import xmlrpclib' but I immediately get an error 'module not found' (full text reproduced below). I found this page where they use 'from xmlrpc import client', but...

AppBundle's Best Practice and how-to go further

According to this page on the documentation website of symfony they explain how to address your application logic and the best practices. The one thing I am missing in this documentation is the way to store and use your entities. There is a small section that covers the usage of...

Stuck with nested serializer using Django Rest Framework and default user

The models and serializers are described in the pastebin: http://pastebin.com/ZxzxWY7V In my database I have a user which also has a member profile and a set of credentials attached to it. Now... when I run this as is and try to pull a user using the AuthUserModelSerializer I get the...

Missing something in this method to get the Entity property

private String[] GetProperties(EContent_EcontentFields eContentField) { List<String> list = new List<String>(); Type fieldType = eContentField.GetType(); var properties = fieldType.GetProperties(); foreach (var prop in properties) { if (prop.MemberType == MemberTypes.Property) { if (prop.PropertyType.IsGenericType) { dynamic items = prop.GetValue(eContentField, null); foreach (var item in items) { Type typeItem = item.GetType(); list.Add(item); } }...

Unique Entity Error message

I have a user entity which have some unique fields. The code bellow shows you how I defined it. /** * @UniqueEntity(fields={"login"}, message="UNIQUE ERROR MESSAGE") */ ...... /** * @var string * * @ORM\Column(name="login", type="string", length=255, unique=true) */ private $login; Developping an API, I would like to be able to...

How to save Facebook private message to database? [on hold]

My question is that is possible save private message from facebook to my database. And if yes, how is it possible? Thank you.

Securing Symfony RESTful API consumed by angular front?

I have set up a Symfony based API which is being used by an Angular front end which is totally dependent of it (User registration included) I have read multiple threads recommending using WSSE or FOSOAuthServerBundle but I'm not sure about the best method ? If I understood correctly, WSSE...

IOS Use Core Data Only in Specific Parts of an app

I'm new to Core Data and trying to use it for persisting objects for offline support in an app communicating with JSON Back-end. I was using NSObjects for my models and now use NSManagedObjects. I only need to save these server objects in a few parts of the app, and...

Reverse GeoCoordinate Class gives Location Not found error

i m using google Reverse Geocoding API in my app, i m succussfully able to get get coordinate using google geolocation API. Now i m trying to get Location Name from Reverse Geocoding API , but always returns Location not found error here is my code: Geocoder geocoder= new Geocoder(MainActivity.this,...

New workbook opened by external app cause macro to stop

I use an application at work to make search on my company database. The application exports search results to an excel file in the “AppData\Local\Temp\” folder. I need this excel file for my main macro to work. Normally I click the buttons in the application manually to make the search,...

how to put a location name programmatically in Google JS autocomplete API and get the results?

When searching for Edinburgh napier university using google autocomplete API, I don't get the state and city, which should be scotland and edinburgh. I want that if the result doesn't include city and state, it takes the postal town name (which in our case is edinbrugh) and search for the...

Instagram API Comments Created using Python (ERROR: AttributeError)

Hello I trying out Instagram API using python and I am new to it. Hope you guys could take a look at it & help me out. I am wondering how to collect the date & time from users that have commented for each media id. I have tried using...

Inbox api use them to tag relevant mails just like inboxsdk.com

I tried using newly released Inbox api to sort out and tag my mails, but I am stuck at categorising mails after I had successfully logged in using api.