Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Arun Raja S.K

Greenhorn
+ Follow
since May 30, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Arun Raja S.K

Hi,

I have been reading book "Pro JPA 2 Mastering the java persistence API ". The chapter 3 of this book gives an overview of EJB and dependency management.

At page number 61, it has been stated that " Dependency lookup is the preferred method for acquiring a stateful session bean instance for a
stateless client
". The book also states that Dependency Injection is not good solution to access stateful session bean from stateless components.

Please explain me, how dependency injection differs from dependency lookup (normal context lookup) in case of accessing stateful session bean, though both types provide only reference to the concerned bean?
Thanks so much Jakachira and abraham. Your inputs are so valuable.

currently am using Pro Jpa 2 Mastering the java persistence API book to study and it also contains a chapter dedicated to EJB 3.1.
So is this book enough to cover EJB topics that i need know for exam ?

Also i came to know about this book from posts in javaranch. But those posts are old, dated back to 2011.
Is there any additional materials like new books or websites containing more useful info about JPA exam available now?
Hi Ranchers,

I am planning to take Java EE 6 Java Persistence API Developer Certified Expert Exam in may.
I have started preparing for it with Pro Jpa 2 Mastering the java persistence API book.

In oracle website it is mentioned as " Oracle Certified JPA Developers for the Java EE6 Platform should have the knowledge required to build robust back-end functionality using Enterprise JavaBeans (EJB[TM]) version 3.1 technology. They are familiar with the EJB technology coding experience of session beans and message driven-beans ".

But the exam objectives doesnt contain any subject related to EJB.

Is EJB knowledge needed to clear Java EE 6 Java Persistence API Developer Certified Expert Exam ? currently i dont have any knowledge in EJB.
so can i take this exam ?

I am confused with this Please help me.
Thanks, i will try implementing LinkedHashMap.
I also read that using lock over the set when we need to modify the set will also help to solve my problem.

// lock the collection
Map<String, Object> values = map.remove(key);
key = new TreeSet<String>(key);
// modify copy of key
map.put(key, values);
// unlock the collection.

Please suggest will above code solve my problem ?
8 years ago
This map is maintained in cache and the maximum size of set is 15. so the set in map is modified whenever latest date is found removing the old date of existing 15 dates. And also the map will always have only one key value pair ie (A key set containing 15 dates and map corresponding to that set.)
8 years ago
Hi,

I am using a concurrent hashmap of structure Map<Set<Date>, Map<String, Object>> SampleMap.

The Map used inside the given map (Map"<"String, Object">") is also a concurrent hashmap,
but set is a only TreeSet type.

Still i get concurrent Modification exception when i add following line in logs,

logger.debug("sampleMap.keySet() + ". Size is " + sampleMap.keySet().size()"); and also in some other parts of same class dealing with this map.

This map is extensively used in Batch process by multiple threads to put and remove values in map and java version used is 1.5.

I think the exception is due to Treeset and also i find there is no similar implementation of concurrent handling collection for type Set.

It would be great if any one confirm whether my thinking over given issue is correct and also please suggest solution for this problem using java version 5 ?
8 years ago
Hi

In my current project JDO 1.0.1 version is used. Now i need to use flush() in my project. but it is only available from JDO 2.0. My colleagues feel changing to JDO 2.0 will be a big change and they do not want to do that for need of this flush() alone. Is there a way to use this method in JDO 1.0.1 without changing to new version OR is there a way to implement same functionality of flush method in some other way in JDO 1.0.1 ?.

It will be very useful for me.
Hi,
I am working on a project and would be grateful if i get a solution. The issue is , i try to perform a delete a row first and next insert a row operation in a table (update is complex here so performing delete and insert ). The table has two constraints, one is primary key constraint and other is unique key constraint (which is a combination of 4 columns). here primary key is a number sequence which automatically increases by 1 whenever a insert happens.

Unique constraint exception is thrown when i try to delete a row and insert a row which has different value in primaryid column and has same values in all other 4 columns as deleted row.

why this exception occurs even though i try to delete the row first and then try to insert new row in table ?

From java side, I first use deletePersistentAll() method to delete the rows and setColumnName() methods to insert values for each columns and then i call makepersistent() method to persist the objects. All this JDO method calls happens as part of Transaction
and Unique constraint exception is thrown when executing commit and transaction is rolled back.

what change i should do to avoid this exception from occuring ?.