Using Axios GET with Authorization Header in React-Native App

For anyone else that comes across this post and might find it useful… There is actually nothing wrong with my code. I made the mistake of requesting client_credentials type access code instead of password access code (#facepalms). FYI I am using urlencoded post hence the use of querystring.. So for those that may be looking … Read more

PDO::fetchAll vs. PDO::fetch in a loop

Little benchmark with 200k random records. As expected, the fetchAll method is faster but require more memory. Result : fetchAll : 0.35965991020203s, 100249408b fetch : 0.39197015762329s, 440b The benchmark code used : <?php // First benchmark : speed $dbh = new PDO(‘mysql:dbname=testage;dbhost=localhost’, ‘root’, ”); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $sql=”SELECT * FROM test_table WHERE 1″; $stmt = $dbh->query($sql); … Read more

redirect after a fetch post call

Request.redirect could be “follow”, “error” or “manual”. If it is “follow”, fetch() API follows the redirect response (HTTP status code = 301,302,303,307,308). If it is “error”, fetch() API treats the redirect response as an error. If it is “manual”, fetch() API doesn’t follow the redirect and returns an opaque-redirect filtered response which wraps the redirect … Read more

query specified join fetching, but the owner of the fetched association was not present in the select list

Use regular join instead of join fetch (by the way, it’s inner by default): String hql = ” select ec.id as entityChangeId, r.id as revisionId from EntityChange as ec ” + ” join ec.revision as r ” + … As error message tells you, join fetch doesn’t make sense here, because it’s a performance hint … Read more

What is the difference between JOIN and JOIN FETCH when using JPA and Hibernate

In this two queries, you are using JOIN to query all employees that have at least one department associated. But, the difference is: in the first query you are returning only the Employes for the Hibernate. In the second query, you are returning the Employes and all Departments associated. So, if you use the second … Read more