Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
15thAirhacks&A.md
@tonda100

This comment has been minimized.

Show comment
Hide comment
@tonda100

tonda100 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]

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]

@michaldo

This comment has been minimized.

Show comment
Hide comment
@michaldo

michaldo 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.

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.

@mart-dominguez

This comment has been minimized.

Show comment
Hide comment
@mart-dominguez

mart-dominguez May 22, 2015

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

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

@agritsik

This comment has been minimized.

Show comment
Hide comment
@agritsik

agritsik 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 http://docs.docker.com/userguide/dockervolumes/#creating-and-mounting-a-data-volume-container and here http://stackoverflow.com/a/20652410

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!

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

Do you use separate "data only container"? Example is here http://docs.docker.com/userguide/dockervolumes/#creating-and-mounting-a-data-volume-container and here http://stackoverflow.com/a/20652410

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!

@veyselkarakas

This comment has been minimized.

Show comment
Hide comment
@veyselkarakas

veyselkarakas 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.

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.

@kgampe5

This comment has been minimized.

Show comment
Hide comment
@kgampe5

kgampe5 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 8.0.0.9 (OpenWebBeans) completly sucks with @alternatives annotations because of bugs (not in WLP).

regards
Karsten

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 8.0.0.9 (OpenWebBeans) completly sucks with @alternatives annotations because of bugs (not in WLP).

regards
Karsten

@braghome

This comment has been minimized.

Show comment
Hide comment
@braghome

braghome 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

https://projectlombok.org

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

https://projectlombok.org

@oedemis

This comment has been minimized.

Show comment
Hide comment
@oedemis

oedemis 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

regards

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

regards

@gilbertoca

This comment has been minimized.

Show comment
Hide comment
@gilbertoca

gilbertoca 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?

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