Jayr Motta

Ranch Hand
+ Follow
since Jul 30, 2010
Jayr likes ...
Google Web Toolkit Java Google App Engine
Merit badge: grant badges
For More
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 Jayr Motta

James, thanks for your past answer.

I've one more question that a friend of mine said and I couldn't test it yet, maybe you help me one more time. Once I called flush in order to send the in-memory changes I did to the database, it will be already committed or it will become part of the transaction that the stored procedure joined?

Thanks in advance!

I've been searching about the possibility of propagate a JTA transaction from Java code to Oracle stored procedures and found nothing really relevant. I'm asking this because a coworker is working with this and told me that it worked for him.

What I'm wondering is a situation where some operation has not been flushed because the transaction is still opened and subsequently a stored procedure is called (this procedure doesn't control it's own transaction), will the stored procedure be able to see the pendent operation in the Persistence Context? In other words, will the Persistence Context synchronize somehow with the transactional memory of the underneath database?

I'm studying for the Oracle JPA exam and such thing is not described in the book I'm reading. However I've read in some websites that I googled and people say that such transaction propagation works because there are a integration between JTA and database transactions in certain JDBC drivers (I just can't imagine how it could work, are the transaction manager aware of database transactions??).

Thanks in advance!


By "move to something else" I meant that maybe I should forget the certifications and start to pursue other kind/set of skills. I'm pretty sure that I'm extremely far to be the best programmer I can be and also to know what I can know, thus, I still want to pursue knowledge in certain areas that I don't have or that I'm not that mature yet (in the case of Spring or architect skills I think that since I'm going to study, I could try the certifications for them in order to make my résumé richer).

I want to become a great Software Engineer, the best I can be, this Java certification path was for me kind of a door. Now that I can see the door clearly, I'm not sure that passing through it is the best choice to achieve my goal, so what I'm asking is for advises about the path I could consider taking in order to achieve that.

Study the things I've enlisted without doing the certifications? How could I practice that if my actual job doesn't require much of that right now? Should I get low on the JVM after getting the knowledge I'm aiming for? Or should I move to other area than Software Development (such as Infrastructure and SO's)?

I know that any answer to these questions will have some of a personal taste and it's different for each person, but still, I want to know what you guys think about it, it is important for me to follow the steps of the great ones and thus taking my owns.

12 years ago

I agree with your point of view, and at the moment that I decided to take each of these exams I was working with the technology of the exam. But this wasn't the only reason I did that, I've realized that the knowledge that I've obtained in each of the certifications made me a better Java programmer, because I could progressively see the whole picture of the Java stack.

Another great thing of doing that was that every technology I got to work after I did the certifications had something in common or have concepts that I could benefit from the knowledge obtained while studying for the certifications. In other words, even the technology not being the same, many frameworks benefits themselves of concepts created in Java official specifications or have concepts that follow the same thought line. An example of it is the transaction model of Spring, its based on the EJB one. Another example is with Servlets, Filters, Listeners, etc, I got to work with many frameworks like Struts, VRaptor, Spring, JSF, Velocity, DWR, etc and each of them are somehow based on the Java-web technologies.

That's a good thing, I guess. Now I'm studying for the JPA exam and that requires me to study transactions in a deepest level of detail again and also the many aspects related to persistence in a Java application with persistence enabled. Even the certifications doesn't meaning anything if the knowledge is not properly obtained (I've seen many dumping questions instead of really learning the subject), it is a good path for Java programmers that may decided to start from scratch to learn a lot of things that may be part of their reality for the next years. Obviously this will require more study on each subject the programmer decides to learn about, but the basis will be there supporting his studies.

About what you said related to keep studying the subjects that I have obtained certifications in order to become a specialist or something like that in that area, sounds good but has it's considerations. I'll much probably not work with EJB so soon, but I do want to study some concepts and areas of it again because I feel that these are present during my days as a Java programmer. The same is true about Java the language itself, the Java web technologies and also with JPA. I think that everything I have learned so far is useful and what is not, is getting down in my brain index, now I'm capable to see what I should study instead of just doing certifications without a clear goal, but once I got so far I'm going to do the architect one in order to help me understand the skills needed by a Java architect.

After that I plan to keep studying what I've learned, others frameworks and technologies, maybe get deep in the JVM world and other languages.
12 years ago
I'm about to do the JPA exam and I'm aiming the architect one, thus, I would like to move to something like core Spring certifications. Therefore, I would like to know about what you guys/girls think about the Oracle certifications and the Spring ones.

I've seen some people discouraging others to take these exams and as I did some of them, I see that nowadays just some of them are really useful in practice. Obviously the inherent knowledge given by studying Servlets, the concepts embedded in EJB and so on are useful and spread among a lot of newer frameworks and tools.

But the doubt remains while I should do it or should move to something else.

Thanks in advance! :]
12 years ago

When the value type of the map is an entity, a join table is used to map the map for a many-to-many relationship or, by default, for a one-to-many unidirectional relationship. If the relationship is a bidirectional one-to-many/many-to-one relationship, by default the map is mapped in the table of the entity that is the value of the map.

I've read this on the Enthuware Test Studio, 1st exam, as the explanation of the question:

You are modeling a relationship between Customer and CreditCard entities where a Customer can have many CreditCards but a CreditCard belongs to only one Customer. Further, you allow the users to associate a name with each credit card that they have. You have decided to use a Map to store the credit cards in Customer entity, where the key is the name and value is CreditCard entity.

Which of the following options correctly defines creditCards field in Customer class?

My doubt is, what the explanation meant with:

If the relationship is a bidirectional one-to-many/many-to-one relationship, by default the map is mapped in the table of the entity that is the value of the map.

This "element collection and mapping relationships to collection types such as Map's" subject is extremely confusing and boring and neither in the Pro Master JPA 2 nor in the simulates are well explained, I'll read this section of the specification and try to really understand it, but until now it's hard.
If you are using Criteria API use projections to select only the fields you want, get them in the result set (an array of objects) or use the bind feature of JPA to bind them with their mapped entity, thus, cast the object to a string and split the string using comma as the regex. But if you are using JP QL or HQL, list the fields you want after the select statement and do the same describe before with the result set.
Dear Suresh,

I have recently took the Oracle EJB exam and I'm currently working with the IoC container Spring. These are two completely different worlds, one you are tied with the application server and web server but each vendor has it's own implementation. This is good because they provide services to a common application program interface and fight for some market share. And if they sell, programmers will have jobs if they learn to understand that application programming interface... Sounds like a pattern huh?

The second, an Inversion of Control container that can with some hooks to the application server provide the same kind of services that EJB does. Further, both have equivalents in SOA and trends that are hot in the market (in my case, I do SOA using VRaptor, a Spring based framework, to expose REST services). They are both extremely powerful and robust technologies to develop both softwares related to the internet with open public or related to some corporation.

The myself of 2012 is moving toward something more simple and well defined, I think that Spring and http based technologies has something on their favor, not limiting itself to the will of a bunch of chairmans, that decide stuff based on their needs first over than what really needs to be done. I do like EJB and believe that with JSR 330, EJB 3.2 and frameworks that implements JAX-RS as RESTEasy or VRraptor it will guarantee a couple more years, or maybe it definitely changes the history of EJB.

Speaking of JSR 330, seek knowledge in the IoC area with technologies such Spring, Guice, Pico, Weld and so on.

Right now I'm studying for the Oracle JPA exam and aiming the architect certification, but I don't know if I should do it without the proper knowledge of the full stack webservices technology of Java EE, what do you think?

Sorry for saying that but you're kind confused about everything you said since you opened this topic. You do know some of the great features / characteristics that EJB provides but what you don't know is what it really is. You've used transaction and persistence as an example of how you replaced EJB by Hibernate but it's quite impossible to say that. I'll assume that you're using at least EJB 3.0 (because you know, we are in 2012 .. almost EJB 3.2), thus, discard the possibility of you're talking about entity beans, though.

Therefore, you can just be talking about JPA and not EJB that could be "replaced" by Hibernate, but again, that's not true once JPA is the interface / specification and Hibernate could be used as the persistence provider underneath it.

I'll not mention some other parts like what you've affirmed about remotability, modularity and security because I would have to dig deep in how the specification provides hooks to technologies related to these features and which of them worth in my opinion or not. Anyway, I think you should review wherever you've read or concluded all these things while reading about EJB, maybe about Spring and Guice too and consider it all again, otherwise you can be doing it wrong.

The question about static classes over JNDI lookup, you must open your mind dude, you're not in the mainframe era anymore, a static class is in the scope of a single JVM and the remotability achieved through SOAP, REST, RMI, etc.. is just a mean to transfer them, JNDI provides you a mechanism to keep registry of values and objects and get references to them over the network.

Just to finish, I would like to emphasize that unit testing your code doesn't play any role in modularity, modularity is about how you are able to shard your codebase across different units (files mostly) and them still have their responsibility well defined, this is related with tight coupling or loosely coupling and so on. Unit testing just help's you avoid regressing the software features and testing each characteristic of each implementation separately.

Don't take my comments and answer wrong, I just want to help! Ok?

Try these:


They'll give you the needed insight about how JBoss works. But in order to really understand what's going on there you'll need to understand each of the technology used to build it and those used to make some features / services available.

I hope it helps you.
12 years ago
Where is your doubt? You shouldn't open a new thread just to say that nobody answers you. Try it on the same thread or research it on the internet, complaining will not help.
For DDL automatic generation you may use JPA annotations and some persistence provider with this feature enabled.
The question is: what you meant with "action"?

Is this a struts action? If so, which struts feature are you using (or any other library you're using) to serialize objects in requests and responses?

If you're going to take your application to this level, I would advise you move to other framework: http://vraptor.caelum.com.br/ with @Consumes( "application/json"). But if you have a lot of code already written using struts, try to find something that allow you serialize JSON objects into the action context and you'll be able to get them already serialized. Something like this http://code.google.com/p/jsonplugin/.

Anyway, consider frameworks like these: VRaptor, RESTEasy, etc, they are more evolved in the "Java web development way of thinking," nothing against Struts but I've been seeing extremely good changes while using http-based technologies! REST with some powerful IoC container behind.

I hope this helps!

If you're reading a recent book, and by recent I mean a book of the newer versions of EJB you may encounter some chapters quoting the older versions of it. This is because you may probably write code with the newer versions of the technology but you'll also maintain legacy code base written in older versions of the same technology. This is always a reality when dealing with Java, keep legacy software's running healthy while writing new software's or migrating the existing ones.

I've been approved in this exam and I can assure to you that the topics related with the older versions are a minority, thus you may focus on what's new.

Good luck!

I'm studying for the JPA certification and while reading a book I encountered the following:

If instead of a many-to-many relationship we had an @ElementCollection of some embeddable type in a Map, we would have to differentiate between the key and the value. We would do this by prefixing the attribute name with "key." or "value.", depending upon which of the embeddable types we were overriding. An element collection of embedded EmployeeInfo types, with the same key overrides as those in the relationship in Listing 5-17, would use the key prefixes:

But I could not understand how a relationship with a real entity could be replaced by this kind of relationship with embeddable types id there is no information about any collection table or any table within the embeddable. I'm kind confused about element collections, I don't know if it's the book that I've bought but it sounds weird sometimes. Does anyone know what the quote above could mean?