Paulo Cesar Dias Lima

+ Follow
since Jul 06, 2010
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Paulo Cesar Dias Lima

Hi Ritchie. I mean Java EE Server side apps.

How to apply new features like common logging system, light-weight JSON API, HTTP 2 Client support  for Java EE apps. Will be available only to Java EE 9?

8 months ago
Whats the best aproach to refactor existing apps to get advantage of Java 9 modularity?
8 months ago
Batch Applications for the Java Platform (JSR 352) vs. EJB Timer Service (java.ejb.Schedule or java.ejb.Schedules annotations.)
I would like to know if is there some recommendation regards the possibility to integration between EJB Timer Service that needs to start a Batch Applications.

Other concern is about if it possible to check the status of execution (running, finished, wait) before EJB timer invokes a Batch process.

Is it possible to Batch process invoke (call back) a EJB method or post a JMS message when finished ?

I checked that JobExecution interface provides methods check status, but I not found a way to notify or register a listener for job conclusion.


Paulo Lima.
Hi James!

Welcome to JavaRanch and Congratulations for your excellent book!

Canvas, SVG, and WebGL on HTML5 Rocks!

Also I visited your blog

Very nice blog and useful information!


Paulo Lima.
Welcome, Ferraro and Aktihanoglu !

Congratulations for you excellent book.

I just read MEAP_Ch01.pdf 1. Location Based Services—past, present and future - FREE is very interesting!

This subject is very updated and fashioned with actual Mobile and Web applications requirements.

I wish you much continued success and many others books published!


Paulo Lima.
6 years ago
Hauke, some users feel more confortable with webapp since most of them uses WEB 2.0 sites and services like emails, search engines, Internet bank, and so on. Some users request WEB 2.0 interfaces and GWT is a strong reference to some then.

Also some components that are free and available to Web/GWT for Swing requires comercial desktop components library.

And as I said regarding Server integration and uses Java EE services I guess that GWT is ready to it since conception.

I like Java Swing to Desktop and Client/Server solutions, also developed some projects builded with J2SE/Swing and only standard Java API (Java IO, RMI, Swing) and several long nights of Java Coding!

Just to focus and go back to topic, I guess that GWT it's not the best choice to my project but for some specific users requirements (like Web experience) could an option and can be done.

All, just to clarify my project is a POS Desktop system coded in Java Swing and integrated with Java Server Side application that mannager stock, sales, taxes, and reports. Both implemented with J2SE. I plan to implement a new version do GWT on client and Java EE on server.

I'm know that Java EE isn't the panacea (a remedy that would cure all diseases) but not the worst.


7 years ago
Subin, my goal is to implement a RIA and improve GUI with WEB 2.0 including GWT and others visual controls that provides better user experience that Swing. I don't know Adobe Flex, my skill is 100% Java and C/C++ actually.

Maneesh, each client machine will have an embedded server to facilities communication with a Central server and access JNDI, JMS, and other container server.

Nowadays I use Socket and RMI instead of Java EE integration support. I konow that It's not a refactory, It's a brand new project.


7 years ago
Subin, thanks for your answer.

I plan to deploy each desktop client machine a servlet embedded server like Tomcat, Jetty, or other.

So each machine will be a lightweight Embeddable Servlet Engine running both Client GWT and Server API to access Serial and USB APIs.

My concern is about if this approach will give more flexible and robust result than Java Swing application.

I plan to go ahead with GWT just for practice and also have a comparation experience to apply.

Also I did some homework regarding this comparation



7 years ago
Hi Federico Kereki.

I need to migrate a Java Swing/Desktop to a Java GWT web application but my concern is about how to access Serial and USB port using GWT.

It's is possible to use a GWT Java application to access Java Communications API (javax.comm) or RXTX directly ?

Do you think that GWT direct access to Serial ports it's a good approach or instead of I should use service server class (like Servlet/Proxy IO) to do this job ?


7 years ago
Jeanne, correct I runned them once a time.

I agree that batch update is integrated so no way to catch individually commands error.

I'm trying to change my Persistence Tier to instead of use JDBC refactory to Stored Procedure that will result the number of rows on Insert/Update/Delete (CRUD) and also using a Queue process like Oracle Advanced Queuing (AQ) to notifies Erros to subscribers Java process.

I have to process a huge amount off request and very short ansewers time!

What do you think about this approach ?

Bill, do you think that using Queuing to catch/notify Huge amount of SQL commands it's a good option ?

I'm not sure if there is a SQL Patterns indicated to this scenario.


Paulo Lima.

I need to process only erros commands in my batch updates according
some numbers of tries.

I'm using PreparedStatement and addBatch to compose batchs commands.

After executeBatch() do executes and receiving results in int[].

Instead of catch BatchUpdateException for the batch commands how to catch only the single error statements ?


Paulo Lima.
Dear Phil Sohar in these case your are comparing 5.0 (double) with (5.0) since 5L was promoted cause binary numeric promotion.

So comparing 5.0 == 5.0 , both double the result is true;

Follows details of explanation form JLS Book reference:

"5.6.2. Binary Numeric Promotion

When an operator applies binary numeric promotion to a pair of operands, each of which must denote a value that is convertible to a numeric type, the following rules apply, in order, using widening conversion (§5.1.2) to convert operands as necessary:
If any of the operands is of a reference type, unboxing conversion (§5.1.8) is performed. Then:

If either operand is of type double, the other is converted to double.

Otherwise, if either operand is of type float, the other is converted to float.

Otherwise, if either operand is of type long, the other is converted to long.

Otherwise, both operands are converted to type int.

After the type conversion, if any, value set conversion (§5.1.13) is applied to each operand.

Binary numeric promotion is performed on the operands of certain operators:

The multiplicative operators *, / and % (§15.17)

The addition and subtraction operators for numeric types + and - (§15.18.2)

The numerical comparison operators <, <=, >, and >= (§15.20.1)

The numerical equality operators == and != (§15.21.1)

The integer bitwise operators &, ^, and | (§15.22.1)

In certain cases, the conditional operator ? : (§15.25)

An example of binary numeric promotion appears above in §5.1. Here is another:

class Test {
public static void main(String[] args) {
int i = 0;
float f = 1.0f;
double d = 2.0;

// First int*float is promoted to float*float, then

// float==double is promoted to double==double:

if (i * f == d)


// A char&byte is promoted to int&int:

byte b = 0x1f;

char c = 'G';

int control = c & b;


// Here int:float is promoted to float:float:

f = (b==0) ? i : 4.0f;



which produces the output:

I hope my post could help you.


Paulo Lima.

JLS Book Reference:
Java™ Language Specification, Third Edition, The
By James Gosling, Bill Joy, Guy Steele, Gilad Bracha
Publisher: Addison Wesley Professional
Pub Date: June 14, 2005
ISBN: 0-321-24678-0

Dear Peter Mularien, regarding Spring 3 Security book approach I would like to know which Patterns you apply to implement Spring 3 Security solutions.

Some issues regarding security that you address is the same that some J2EE Core Security Patterns propose solutions like for example strategies for Identity management.

Do you think that associate and relate Spring 3 Security approach with J2EE Core Security Patterns a good way to learn and apply J2EE Spring Security robust solutions ?

Best Regards,

Paulo Cesar Lima.
7 years ago
Dear Peter Mularien congratulations for your excellent book!

I just downloaded and read the sample chapter 4 securing-credential-storage and it's really cool!

I' sure that Spring's Developers could enjoy all these very useful informations and practical tips provided in your book.

I hope I have luck to win a copy of Spring 3 Security this week in the Spring forum, but if not for sure I will buy one.


Paulo Cesar Lima.
7 years ago