QBFC: Can I call multiple concurrent calls to quickbooks through one session? - intuit

I am currently creating a new quickbooks session for every unique "thread" coming into my SDK app. In that session, I do some quickbooks stuff.
It seems to be working well, allowing multiple things to happen at the same time. The problem I have, is that the session sometimes takes a while to "open".
If I create a single "global" session, can I call that concurrently form my individual threads? Will quickbooks allow me to make concurrent sdk calls through the same session?
I would like to get some insight into this before I go and change my currently working code...
Thanks

Yes, you can make multiple calls under one session open. They have to be sequential. They cannot run in parallel. So you can only have one connection open to QB at a time.

Related

Best way to keep in sync data in two different applications

I have 2 closed-source application that must share the same data at some point. Both uses REST APIs.
An actual example are helpdesk tickets, they can be created on both applications and i need to update the data on one application when the user adds a new ticket/closes a ticket on the other application and vice versa.
Since is closed-source I can't really modify che code.
I was thinking I can create a third application that every 5 minutes or so, list both applications' tickets for differences on the precedent call, and if the data is different from the precedent call it updates the other application too.
Is there a better way of doing this?
With closed-source applications it's nearly impossible to get something out of them, unless they have some plugin-based setup that you can hook into.
The most efficient way in terms of costs would be to have the first application publish a message on a queue, or call a web-hook that you set, whenever the event is triggered. But as I mentioned, the application needs to support that.
So yeah, your solution is pretty much everything you can do for now, but keep in mind the challenges that you may encounter over time:
What if the results of both APIs are too large to be compared directly? Maybe you need to think about paging the results.
What if your app crashes and you loose the previous state? You need to somehow back it up in an external source
How often you should poll the API to make sure you're getting the updates you need, while keeping a good performance for the existing traffic?

Emit data to all clients on a Google Web App

I have a Google Apps Script bound to a Google Sheet, and have published that as a Web App. It is restricted to a certain Google Workspace. That Google Sheet is kind of an improvised database for that web app and changes over time. I would like to send the updated data to all clients once the Google sheet gets changed. Is that possible? I don't need a trigger for the edit, since I know in the script when I add new data, so this is the time to send the new data.
Basically the same question can be formulated as follows: We know that we can execute a server-side function from the client with google.script.run, but is it also possible to execute a client-side function from the server i.e. the apps script?
My current workaround is a client-side setInterval which checks for server-side updates (and fetches them using successHandler) every 30 seconds or so. It works, but is not optimal.
Just to mark this one as answered. Cooper writes in the comments:
"It's not possible to execute a client side function from the server unless it has been first initiated by the client and it's responding with a callback. Polling is your only option I think."

How can I tell if my Entity Framework application is multi-threaded?

Ok, so I came to this company that recalled its software from an offshore, no-longer-extant entity. We all know the drill.
In looking at the nuts and bolts, I come across the 'lock' keyword. Googling, I find that Entity Framework does not support multi-threading.
My question is: How can I be 100% certain that the application is attempting to run in multiple threads? Is the existence of the 'lock' keyword enough?
Thanks.
If this is a ASP.NET/MVC web app and you have the lock keyword that is probably because the app is in IIS and IIS dispatches different user requests on different threads and therefore web app becomes multi-threaded.
In case of MVC - Controller is created per request and then it is processed on different thread. That leads to the need to lock something if two users at a time are going to access it.
If this is a desktop app and the lock is where data access happens it might be for similar purpose.
The lock keyword alone is not enough, they could be using it incorrectly after all. lock will just prevent more than one thread from entering the protected area at any one time. What is being protected by the lock? Data stored in a static variable is available to all users (threads) using the app and so should have controlled access.

Google.GData.Documents.DocumentService.Query() hangs in multithreading

I am tying to download documents of multiple users simultaneously using threading.
The application download documents for some users and eventually all the threads get stuck at the following statement.
Google.GData.Documents.DocumentService.Query()
However if I try to download them one user after the other (no threading). It downloads just fine. Every thread has its own instance of DocumentFeed, DocumentsListQuery,Document Service etc
The application is developed in c#. What could be the possible reason for it to get stuck on the "query()" statement?

Make Sessions Persist across computers in PHP?

I am trying to make a online chatting application.
How do I make a variable persist across users logged in from machines from different places in PHP?
I tried using session_write_close method but didn't work out.
Please guide with a step by step procedure. Many thanks.
Sessions are per-browser. The session id is most commonly stored in browser cookies, or it can be passed around directly with each request. Either way, you cannot use the same session on different computers, not even multiple browsers on the same computer.
Instead of persisting the session, you can persist variables the same way you store user configurations, for example by saving settings in a database. The variables you want to store should be tied to the user account, not to the session.