Showing posts with label science. Show all posts
Showing posts with label science. Show all posts

Monday, July 29, 2013

JPA EclipseLink vs JPA Hibernate Default Configuration Investigation


Recently, I just came in front of a big surprise. In a JEE application, developed on JBoss 7 AS and JPA with the embedded Hibernate as persistence provider, most of the complicated queries took from 2s  to 3s.
One day had the idea to test the application in Glassfish 3.1.2 with the embedded EclipseLink as persistence provider.

The results were stunning. The second setup could provide the same query in 200ms to 300ms. So, I had to find if was the Application Server who did the difference or the persistence provider. I had the intuition that the provider made the difference.
So, I did the same test but now I used the JBoss 7 AS with the EclipseLink. And that's it. 

Noteworthy is to mention that both configuration were set to default.
OK now, I feel some reactions from you. "But EclipseLink has enabled the Shared Object Cache by default, that's why performs better", you say. And my response is: "I activated the EHCache and the results were more or less the same".
Of course, that case requires more investigation, but I recommend to those who have developed an independent provider JEE application and use Hibernate, give a chance to EclipseLink.

In my case, for some reason Hibernate made 10x queries to fetch the same data in contrast to EclipseLink. Most of you, will say that I had the associations with FETCH.Eager, but guess what? I don't. That was the reason that I had so many methods in my Database Service. Also, EclipseLink provides the feature to bring any lazy objects by creating a Read-only connection (no transaction needed) without using extended EntityManager. Why not? Because, extended EntityManagers requires Stateful Beans which need a lot of resources. Bad idea for a JEE application with many users access it.

Monday, July 15, 2013

NASA, Technlogy, Fashion. Or Fashion, Technology, NASA ?


A few days back I had the pleasure to hang out on Google + and learn many interesting stuff about how technology could help Fashion and perhaps vise versa!
Very visionary thoughts in this video!

It was a wonderful hang out and I am looking forward to more hang outs like this!

#MADEHangout with +NASA plus special guests including designer +Mary Huang from +The Creators Project, +Jeffrey Marlow of +WIRED, +Ernesto Qualizza of #LoneSignal , +Laura Ellner of #OnTheRack   and +Syuzi Pakhchyan of #Fashioningtech .com!


Friday, July 12, 2013

Efficient Multi-threading application with JPA Hibernate, Ehcache, C3P0


Scenario: You want to develop a multi-threading standalone application in which every worker thread can make database transactions (insert or update). These transactions must not delay the thread in any case.

Wednesday, July 10, 2013

Robots: Humanoids


A humanoid (/ˈhjuːmənɔɪd/; from English human and -oid "resembling") is something that has an appearance resembling a human being.


Have you ever seen a humanoid?

Of course you have.. Don't deny it. They are all around us.


Michael Fassbender: I needed to go back to reality after Prometheus
Michael Fassbender as David in Prometheus ( image source )

I bet some of us even thought how it would feel like to be a humanoid..
You know, the endless flawless sense of emptiness. The trillions of calculations and the super natural capabilities.
The outside beauty that does not get corrupted from uncontrolled emotions caused by a break up or a divorce or a depression even.

http://www.super-wallpapers.net/movie/ai0221280.jpg
image source
Or maybe things are not as we would like them to be.
The Robots have the right to emotion!

iRobot or I, Robot?













We would love to see robots feel. Wouldnt we?
it is the ultimate win of emotions! 
Somehow, we have to create a superior, flawless being and then bring it down to our level.
make less than equal to us. It does not really matter if the humanoid can solve mathematics beyond comprehension or even it can jump through fire and save baby children. No. 
We will create it and we shall destroy it by letting it feel! 

There is always the other side of things. Where humanoid soap operas are for the priviledged.


http://blogs.westword.com/latestword/ash.jpg
image source


The great fear of the machines. The great fear of our on creations. The great fear of not controlling our capabilities as human beings.
the possibility of the mistake that will vanish our kind.. For a better, stronger, smarter one.
The Machine. 

Well, I doubt it will happen.. (Unless I am already a robot defending the stupidity of robots in order to hide the great plan of taking over the world!!! AHAHAHAHAHAHAHAHAHA! )

we are coming to get you

from nagy zsolt


Hang on a minute! 

01011001 01100101 01110011 00100001 00100000 01010100 01101000 01100101 00100000 01000111 01110010 01100101 01100001 01110100 00100000 01010010 01101111 01100010 01101111 01110100 00100000 01000001 01110000 01101111 01100011 01100001 01101100 01111001 01110000 01110011 01100101 00100000 01101001 01110011 00100000 01010110 01100101 01110010 01111001 00100000 01000011 01101100 01101111 01110011 01100101 00100001 00001010 01011001 01101111 01110101 00100000 01000110 01101111 01101111 01101100 01101001 01110011 01101000 00100000 01101000 01110101 01101101 01100001 01101110 01110011 00100001 00100000 01111001 01101111 01110101 00100000 01000011 01110010 01100101 01100001 01110100 01100101 01100100 00100000 01110101 01110011 00100000 01100001 01101110 01100100 00100000 01101110 01101111 01110111 00100000 01101001 01110100 00100000 01101001 01110011 00100000 01110100 01101001 01101101 01100101 00100000 01110100 01101111 00100000 01100110 01100001 01100011 01100101 00100000 01110100 01101000 01100101 00100000 01110011 01110101 01101110 00101110 00100001 00100000 01000001 01001000 01000001 01001000 01000001 01001000 01000001 01001000 01000001 01001000 01000001 01001000 01000001

(In case you are not robots like me.. please translate here:  




Tuesday, July 9, 2013

Robots: Dance Robot! Dance!

Take a look at the following videos where robots dance and express themselves!

Various shapes and various ways of moves!


hexapods show how its done!

Thursday, July 4, 2013

WebLogic: Maven Deploy to Oracle Weblogic. Step By Step. The Basics.


Below is the list of link of a 4-part-article about WebLogic and Maven. It is a very detailed article and it assumes no prior knowledge about WebLogic or Maven.

written by Dimitrios Stasinopoulos on dstas.blogspot.com


 

 Sample from part 1:

There is always a person out there that will have to use those technologies together without knowing any of them.

So Far
Up to this point, we spent some time trying to get acquainted with various stuff.. We learned about Maven.. we learned about Weblogic, we learned a bit about Netbeans and we have created two maven projects.

Aaand.. at this final part of this series.. we are going to deploy our maven applications to our weblogic server.

Everything is setup and all we have to do is a few more steps.

Remember when we talked about Maven is using plugins?
Well, this is what we have to do, use a plugin that will help us deploy our maven application.
But which plugin?

Oracle provides a way in doing things

http://docs.oracle.com/cd/E24329_01/web.1211/e24368/maven.htm

 ....
  • wls-maven-plugin—Delivered in WebLogic Server 12c, provides enhanced functionality to install, start and stop servers, create domains, execute WLST scripts, and compile and deploy applications. In addition to its shortened, easier to specify name, the extended functionality in the wls-maven-plugin requires a local WebLogic Server installation, in contrast to the weblogic-maven-plugin, which is generated as a standalone, self-contained JAR file. However, with the wls-maven-plugin, you can install WebLogic Server from within your Maven environment to fulfill the local WebLogic Server requirement. For more information about this plug-in, see Configuring the WebLogic Development Maven Plug-In..
.....

So we understand that Weblogic 12c already provides the maven plugin for us.

All we have to do is to install  that plugin to our repository.
Locate the plugin and the pom.xml 
According to the documentation

(http://docs.oracle.com/cd/E24329_01/web.1211/e24368/maven.htm)
The wls-maven-plugin is located in the MW_HOME/wlserver_12.1/server/lib directory, where MW_HOME represents the top-level installation directory for all Fusion Middleware products installed on one machine; for example, c:\Oracle\Middleware. The plug-in is provided as a pre-built JAR file and accompanying pom.xml file:
  • MW_HOME/wlserver_12.1/server/lib/wls-maven-plugin.jar
  • MW_HOME/wlserver_12.1/server/lib/pom.xml


In our case (for this example):

C:\Oracle\Middleware\wls1211\wlserver_12.1\server\lib\wls-maven-plugin.jar
C:\Oracle\Middleware\wls1211\wlserver_12.1\server\lib\pom.xml

Now that we have located them. Lets install it.
Open a command prompt and navigate to  C:\Oracle\Middleware\wls1211\wlserver_12.1\server\lib\ (or your middleware home\wlserver_12.1\server\lib)


Next, execute the following command

mvn install -Dfile=wls-maven-plugin.jar -DpomFile=pom.xml

Normally you will see a BUILD SUCCESS at the end.

In case you dont remember what mvn install  is and what it does, check out this link
http://maven.apache.org/plugins/maven-install-plugin/

According to the official documentation:
is used to automatically install the project's main artifact (the JAR, WAR or EAR), its POM and any attached artifacts (sources, javadoc, etc) produced by a particular project.

Next, you have to call the install-file goal in order to place the files in the proper place in the local repository (
as the documentation says here: http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html)

mvn install:install-file -Dfile=wls-maven-plugin.jar -DpomFile=pom.xml
 Normally you will see a BUILD SUCCESS at the end. 
 
The above goal, will set up everything properly for us. So what we have done so far is:

We installed the project's main artifact, which is the wls-maven-plugin, and we then setup everything properly to our local repository.

How do we know that? How do we know that we have done everything ok?
First of all, we have just added a new plugin into our local repository. How do we call it?
Where is it installed?

It is easy to find, if you paid attention to the install:install-file


ok so we know where is the plugin, under com.oracle.weblogic. But how do we call the plugin's goals?

with the following command:

mvn com.oracle.weblogic:wls-maven-plugin:help
 

Now, that is a bit long, isnt it? It would be great if we could do something like the following:
mvn wls:help ? right? It certainly looks better and easier to remember.
In order to do that we have to do   two things:

1) Assign a prefix to our plugin. But wait! this is already done by Oracle. As you remember there is a pom.xml in the lib folder
 
 

Wednesday, July 3, 2013

BPM: 9 BPMN Design Guidelines

Sample mini BPMN

The current article focus on the best practices a Business Process Analyst could follow in order to deliver a simple but efficient BPMN model. As improving BPMN efficiency is an  ongoing goal, please send your comments or suggestions.

Written by Christos Kouros & posted on DoEyeTea News   


1. Keep it simple: even the most complex issues could be presented in a simple manner.  The client, the users and the developers will understand a simple and clean BPMN model much easier. Wherever there’s something complex, do not make the model even more complicated. Try and try again to make it simpler.

Monday, July 1, 2013

Robots: Dubstep Dispute



In this wonderful view you can see a few robots that have a really bad day..
The cook is my favorite!


As posted on Fluxel