Using GORM – Part 3: Models and Idempotency

Previous posts in the series: Part 1: Introduction Part 2: Transactions and Save Points So far, GORM has helped us abstract our data-access logic and removed the need to write SQL queries directly, but is everything perfect? In this post, I will cover some of the pitfalls I’ve noticed and…

Using GORM – Part 2: Transactions and Save Points

Previous posts in the series: Part 1: Introduction Now that we know the basics of working with GORM, let’s cover a few more advanced topics. Transactions Transactions are an essential concept in relational databases that allow developers to ensure data consistency and integrity. A transaction is a sequence of operations…

Using GORM – Part 1: Introduction

In today’s software development landscape, Object-Relational Mapping (ORM) has become an essential technique for managing relational databases. ORM allows developers to work with databases using an object-oriented approach without having to write SQL queries. ORM tools provide a set of methods that abstract away the complexity of dealing with databases…

Can I inject this class ?

One of the biggest pain points using injection in Java is that if you missed something, you will find it during runtime. Many code commits were made where everything passed the code review, and looked legit, just to find out that it doesn’t work due to a missing injection. Let…

Is it really a Singleton?

Recently, I have investigated a defect that is interesting to share. As part of our operations, we need to be able to run tools, which will invoke APIs on different AWS services. For example, one common tool is to run a certain CloudWatch query and analyze the results. The framework,…

Marking field as required when using Lombok Builder

The builder pattern is nice and useful, and using Lombok @Builder annotation instead of implementing it each time can save a lot of time. However, there is one problem with this. You can’t really define a required field. For example, Let’s assume we have this class: 123456@Value @Builder public class…

Life got much easier – Using Lombok with Java

After more than 5 years programming in C++, recently I’ve started my first steps programming in Java. There are many differences and I’ll try to share some tips that will make your lives better 🙂 First one is Project Lombok. From their documentation: Project Lombok is a java library that…

How to consume all messages from an SQS queue ?

My goal was finding an AWS service that will answer the following requirements: Store large amounts of data (split into small chunks) reliably. Accessible from multiple zones/regions. Low read/write latencies. Cheap enough. SQS is a powerful service that is really useful for de-coupling between micro-services and allowing reliable transfer of…

Getting the right Jenkins build number using Python

One of the jobs in our CI pipeline is responsible for compiling, building and packing the code. The artifacts of the job is a directory on our storage with the build number and all the artifacts that are related to this build number. For example: //storage/build_1000, //storage/build_1001 and etc. There…

Bash Tips & Tricks: Handling failures in pipe

If you’re using bash, you probably know that pipes are really nice and helpful. Recently I wasted a lot of time trying to realize why one of our tests failed on data corruption (we are kind-of a storage company so this is bad) and the results were amusing (or sad,…