Docker Mastery

Posted on Posted in Java, Technologies

Below are more detailed notes on various aspects of Docker, and somewhat more advanced topics with dealing with container/image management. Docker commands are now separated into main modules. previously when you wanted to run a command, you would do docker <command> In the newer version you can say: docker <module> <module_command> Modules config – Manage […]

Akka Immutable Messages

Posted on Leave a commentPosted in Akka, Java

By default Akka does not make your variables immutables, so if you are passing around message/objects with mutable variables there is still a case where you can experience a deadlock. That is why it is highly recommended to use immutable messages when integrating with Akka Actors. What are immutable messages? Basically these are variables that […]

Actor Hierarchy

Posted on Leave a commentPosted in Architect, Java

Akka Architecture by default supports parent-child Actor structures. On startup Akka already creates several actors for you: http://doc.akka.io/docs/akka/current/java/guide/tutorial_1.html Root guardian – to handle all the actors System guardian – Akka System guardian User guardian – user in this case is you, user guardian manages all the actors created by the developer. Usually you can only […]

Static vs Instance variables

Posted on Leave a commentPosted in Java

Static vs Instance variables When you declare a variable static, there is only one copy of that variable per class. Consider the following example (bad encapsulation code do not copy): when we use static, there is only one copy per class, so no matter how many Humans objects we have, there is only one PLANET, […]

Set vs List vs Map

Posted on Leave a commentPosted in Architect, Java

Basic Question in Java is usually what is the difference between Set/List/Map. Set – is used usually used when you want to keep a collection of items that have no duplicates. Plain and simple. So think set when you want a unique collection of items. Variations TreeSet (interface: SortedSet) – sorts the value in the […]

React JS Notes

Posted on Leave a commentPosted in Architect, Technologies

This is not suppose to be a comprehensive guide on how to use React JS, but more of a cheat sheet if you need a refresher on how react works. React Key concepts components structured – Files are separated in what they call components, and each part of the page would have their own js […]

Docker Introduction

Posted on Leave a commentPosted in Architect, Java

What is Docker?  “Docker is the world’s leading software container platform. Developers use Docker to eliminate “works on my machine” problems when collaborating on code with co-workers. Operators use Docker to run and manage apps side-by-side in isolated containers to get better compute density. Enterprises use Docker to build agile software delivery pipelines to ship […]

EnumType.Ordinal vs EnumType.STRING

Posted on Leave a commentPosted in Hibernate

How to Map Enum to hibernate class: @Entity @table(“d_user_group”) public class UserGroup { @Enumerated(EnumType.STRING) @Column(name=”user_group_status”) private UserGroupStatusEnum userGroupStatus; public enum UserGroupStatusEnum{ Active, Draft; } } In the case above we have a table d_user_group, that will have a column user_group_status, that only accepts Enum as a parameter. If you specify EnumType.String it will store the […]

Hibernate – A collection with cascade=”all-delete-orphan” was no longer referenced by the owning entity instance

Posted on Leave a commentPosted in Hibernate

Hibernate Class: @Entity @Table(name=”Person”) public class Person{ @OneToMany(mappedBy = “children”, cascade = CascadeType.ALL, orphanRemoval = true) private Set<Child> children; … //setters and getters }   Error occurs when in controller you are trying to set it to null instead of clearing the set/list, the following pseudo code will throw an exception as “A collection with […]