Jhon Gonzales

+ Follow
since Jul 22, 2013
Jhon likes ...
PHP Java Linux
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jhon Gonzales

[com.edwin.Suma@1540e19d, com.edwin.Suma@677327b6, com.edwin.Suma@14ae5a5]
[com.edwin.Suma@7f31245a, com.edwin.Suma@6d6f6e28, com.edwin.Suma@135fbaa4]

6 years ago
Because I have seen it in a code and the code works. The code have the flowing structure:

There is an Entity named A, with a relation with entity B. The relation is OneToMany using a Join Table and the Owner in the relation is the Entity A. B is an Entity with predefined inserts, so its only used for reference in relations.

So, when there are creating a new Object A for persist it, they don't use find or reference for get a reference of an entity B and add it to the list, instead they create new Object of B, assing its a primary key and add the new Object B to the List that Belong to the Object A. And the code works and i don't understand why its work.
Hello Guy, I have this doubt. May I create a new object that represent an entity and assign an existing primary key, and use this object for reference to an existing entity, instead of use getReference or find method of EntityManager?.

Hello Guys,

I'm building an Application. The all the business logic is written using EJB, so I have to expose my business as Soap Webservice using JAX-WS. I have to create an iteration layer to communicate the client with my business. So I could create my iteration layer using JAX-WS + EJB but i could create my iteration layer using Servlet + JAX-WS.

What will be the recommended stack (JAX-WS +EJB OR Servlet+JAX-WS) for having better performance, less use of resource and process assurance. The number one priority is that all processes will be executed successful and the a lot of client will be acceded to the application.

PD: The application will be running inside a Cluster.
That error occurred because there isn't an index 1 at tokens's array. You should check if the token's array have 4 elements before assign the value to the variables.
6 years ago
Take a look at Decorator Design Pattern
6 years ago
This type of programming its important to control correctly when you are working with EJB. If an EJB throw a System exception (that its designated to propagate to the container and rollback the transaction) but you catch the transaction because you don't except that type the behavior. Your application will not behave in the way that you think that should behave, and its possible that you will have a logic error in your app.
6 years ago
Thanks for the information @Himai Minh and the link.

I get it. The correct (because is the portable way) way for getting a Queue destination is using the lookup attribute.

mappedBy will works in some application server and in other it will not work.

The name for getting a Queue destination will works in some application server like Glassfish. In glassfish if you only supply the name attribute and that name is the same of a jndi direction of a Queue destination, glassfish will use it.

Hello, I have seen in some places that people using different attributes for getting a queue reference using Resource annotation. I have seen the following attributes:

@Resource (name = "....")
@Resource(mappedBy = "....")
@Resource(lookup = "....")

Which one is the recommended?? Because I could get wrong in the exam. And in the enthuware mock exam for EJB, They recommend that I should use lookup attribute for java portable jndi (java:global, java:module, and java:app) and not for getting a reference of a Queue.


Thanks, I understand it now, thanks.

By the way, I will buy your mock exam, I think that it would be helpful.


i would like to know the difference between name, beanName, and lookup attributes of EJB annotations. Because when i call an EJB using the lookup attribute, also i can use name attribute for locate the EJB.

And when i'm using MDB, i can use mappedName attribute with resource (that is EJB's attribute too) annotation for locate JMS's resource factory and JMS's destination resources.

Hello, i have a problem with an OneToMany relationship. I try to get the List but it does not return anything. Theses are my sources:

This the Main:


Name: Edwin
Size: 0

Tables info:

The entities tables:

The first one is a array of array (Two dimensional) like this one: String [ ][ ] args. The second and last ones are one-dimensional arrays.
7 years ago