Skip to content

Instantly share code, notes, and snippets.

@AdamBien AdamBien/15thAirhacks&
Last active Aug 29, 2015

What would you like to do?

This comment has been minimized.

Copy link

tonda100 commented May 5, 2015

Visibility of instance variables inside EJB. I was taught to use as strict visibility as possible that means in most cases "private". There is no visibility modifier for instance variables in your EJBs, that means you use default visibility (package private). Why? What is the logic behind that? [Antonin]


This comment has been minimized.

Copy link

michaldo commented May 7, 2015

Do you agree that concept of EJB bean pool is dead end? For me @ApplicationScoped singleton is much simpler but equally powerful. Stateless EJB taken from pool is assigned exclusively to handle single request. Did you ever used or seen case that application code really utilize fact that single request is handled by the same instance of EJB? If not, then @ApplicationScoped singleton is enough and simpler.


This comment has been minimized.

Copy link

mart-dominguez commented May 22, 2015

How do you test with Arquillian a REST (JAX-RS) method ? Any simple example?


This comment has been minimized.

Copy link

agritsik commented May 29, 2015

Could you suggest how to utilize effectively docker for the database layer?

Do you use separate "data only container"? Example is here and here

Am I right that for any simple web application I need 3 docker containers. For example:

  1. web container (created from glassfish or tomcat image)
  2. db container (created from mysql image)
  3. data container ("data only container")

And for microservices I can use the same approach? Each microservice has 3 containers: web + db + data only container.

Thanks you!


This comment has been minimized.

Copy link

veyselkarakas commented May 29, 2015

Hi Adam,
I have a question about JPA and the Entity relationships.
For bi-directional OneToMany relationships, doesn't JPA copy the ID of the grater (One) Entity in the table of the smaller Entity (Many). If so, can you show me a simple example.
I have two classes "User" and "Address". Many User can live in One Address, so I crated the relationship like following:

public class User{
@manytoone @JoinColumn(name="address_id", referencedColumnName="id")
private Address address;

public class Address {
@OneToMany(cascade= CascadeType.ALL, mappedBy="address_id")
private Set users = new HashSet();

When I start the server and run the Project, I get different "address_id" in the "User"-table when I save the formular.

can you show me a solution?

Thank you very much.


This comment has been minimized.

Copy link

kgampe5 commented May 29, 2015

Hi Adam,
i have a question about handling to implementations of an interface and injecting the implementation to an interface-type injection point:

Normally, this could only be done if one implementation of the interface is in classpath, otherwise, CDI will throw an exception because it could not be choose the right impl. If you have 2 impls in classpath you coud use @alternatives annotation to handle it somehow.

Now my question: is there a different approach to tell CDI that a specific implementation should be used if 2 impls are in classpath without changing code (qualifiers, ...)? I have the problem that WebSphere (OpenWebBeans) completly sucks with @alternatives annotations because of bugs (not in WLP).



This comment has been minimized.

Copy link

braghome commented May 29, 2015

Hi Adam, I have often seen to typing model objects in your screencasts which I always find it strange as I personally use @value


This comment has been minimized.

Copy link

oedemis commented May 29, 2015

Hi Adam, How can is simulate a JavaEE application deployed with docker on AWS with thousands of users to test scalability? Can you show a practical example



This comment has been minimized.

Copy link

gilbertoca commented May 30, 2015

For someone who knows java, works with spring (spring-data + spring-security + JSF) and wants to study/learn/work with JEE but doesn't know where to start (lots of resources out there, but no one at his(me and others I think) level). Is your book appropriated? Isn't it outdated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.