• Commerce,  Episerver,  ServiceAPI,  Tips

    ServiceAPI + Postman, a match in heaven

    No, it’s just a note-to-self. A lot of customers have been using ServiceAPI, and to great successes. We also have very good documentation here – of which largely thanks to my colleague Mark Hall. But what if you want to play around with ServiceAPI and don’t want to write app/build/run it yourself? The answer is simple: There are many REST Clients can do the job for you, and Postman is usually regarded as the best/most popular one. But, the documentation are for C# client, it can be quite confusing to use Postman to work with ServiceAPI for the first time (or times). If you are experienced with Postman, great! But…

  • Learning,  Life,  Random thoughts,  ranting,  Tips,  Uncategorized

    Choose your battles

    This is the third part of the series: How to survive and thrive – a series for new developers to become better at their jobs. You can read the first two parts here and here. In military, there is a term of “uphill battle”. That when you have to fight your way up a hill, when you enemy controls the top. It’s a very difficult fight and your chance of success is low. Any experienced military leader knows uphill battles are something you should avoid until there are no other options. That also applies with any jobs. Including programming. The truth is, you shouldn’t fight the battles you can’t win.

  • Catalog,  Commerce,  Episerver,  Performance,  Tips,  Uncategorized

    Mass update catalog entries

    This is something you don’t do daily, but you will probably need one day, so it might come in handy. Recently we got a question on how to update the code of all entries in the catalog. This is interesting, because even thought you don’t update the codes that often (if at all, as the code is the identity to identify the entries with external system, such as ERPs or PIMs), it raises a question on how to do mass update on catalog entries. Update the code directly via database query. It is supposedly the fastest to do such thing. If you have been following my posts closely, you must…

  • Catalog,  Commerce,  Episerver,  Performance,  SQL Server

    A curious case of SQL Server function

    This time, we will talk about ecfVersion_ListFiltered, again. This stored procedure was previously the subject of several blog posts regarding SQL Server performance optimizations. When I thought it is perfect (in term of performance), I learned something more. Recently we received a performance report from a customer asking about an issue after upgrading from Commerce 10.4.2 to Commerce 10.8 (the last version before Commerce 11). The job “Publish Delayed Content Versions” starts to throw timeout exceptions. This scheduled job calls to a ecfVersion_ListFiltered to load the content versions which are in status DelayedPublish, it looks like this when it reaches SQL Server: [crayon-5c117ed1b846b772359502/]This query is known to be slow. The…

  • Commerce,  Episerver,  Order

    Loading carts in a load balancing environment

    UPDATE 1: Apparently HttpContext.Current.Request.AnonymousID already uses the cookie internally, so there might be something that makes it stop working. I’ll update when I found out. Today we received a support ticket as customers seeing corrupted carts data being lost – line items with invalid data, duplicated line items etc. “Corrupted data” is one of the alarming words that we take very seriously, so I decided to jump on it right away. The setup is a load balancing environment, and the problem only happens with anonymous users. However, it can be “fixed” by turning on the sticky sessions mode. So basically, instead of having sessions on the memory of a server (so sessions…

  • Book,  Commerce,  Episerver

    Announcing a new book: Episerver Commerce: A problem – solution approach

    More than one year ago, I announced that I was working on a book – a first Episerver Commerce book ever. It has been a work in progress until recently – and I am still adding updates here and there. The book has received quite positive feedback (I’m happy to say that everyone is nice enough to not tell me “Your book sucks”. Thanks, everyone). Am I happy with it? Yes, of course, proud even. But to be completely honest, I know something was missing.

  • ranting,  Writing

    Why do games need more Elena (Fisher)

    Elena’s a strong, independent woman, with her own motivations and thoughts. She’s indeed attractive (very attractive if you think about Uncharted 4), but in terms of being healthy and fit, not being overly sexy as a “fan service” (Japanese games, I’m looking at you)   She’s not some female characters who are over-confident, and/or over-powered, to the point they don’t even need men. She does not work alone. She works with Nathan Drake to overcome the odds.

  • Collection,  Random thoughts,  ranting,  Tips,  Writing

    The art of asking questions

    This is the second part of a series about most important skills for developer. The first part, about searching for answer skill, can be read here. Searching for the answer is usually the fastest way to solve a problem But searching on Google might not be enough to find you the answers, you might be the first to encounter the problem, or you might be searching for the wrong keyword. Sometimes, you have to ask the questions, hoping that some one, some where does know about the problem, and is kind enough to spend some time reading your questions, and typing the answers. For free.

  • Learning,  Random thoughts,  ranting,  Writing

    The most important skill (of a good programmer)

    Being programmer(*) is hard. Being a good programmer is, of course, even harder. Unlike countless other jobs where the daily work is a routine, and being good at your job is to be efficient at that routine, being programmer is all about constantly learning and doing new things. Being a good programmer is about being fast at learning, and doing new things well. The process might stay for a while, but the content of the job is constantly changing. (If you keep doing same content over and over again, you are doing it wrong)

  • Commerce,  Episerver,  Order,  Performance,  SQL Server

    Optimizing T-SQL COUNT

    This is a continuation of my previous post about paging in SQL Server. When it comes to paging, you would naturally want to know the total number of rows satisfying, so you can display some nice, useful information to your end-users. You would think, well, it’s just a count, and a simple query like this would be enough: [crayon-5c117ed1b97c5921860536/] There should be nothing to worry about, right? Actually, there is. Let’s get back to the example in previous post – we have to count the total number of orders in that big table. [crayon-5c117ed1b97cd355219542/] Because ObjectId is the clustered index of OrderGroup_PurchaseOrder, I did expect it to be use that index…