Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!

Claude Moore

+ Follow
since Jun 24, 2005
Claude likes ...
IBM DB2 Netbeans IDE Spring Java
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 Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Claude Moore

I wonder if it's possible to run a licensed copy of Mac OS on VMware or similar VMs players, and, using it, to develop and distribute apps on Apple store. Reading here and there on the web, it seems that while it is technically possible, it would be  a license infringement  - you can run MacOS only on MacOS hardware.
Any advice ?
1 week ago

Tim Holloway wrote:
Of course, you can overdo the whole microservice thing. Breaking down apps into sand-granule size may simply complicate things and not save any resources at all. And while there is a certain advantange to making different parts of the app be "black boxes" to other parts of the app, you can also end up not understanding what anything is doing. So, as in all things, some planning is required. And the design should be flexible enough to change, since actual system use almost always show different requirements than what the planners originally envisioned.

Tim's 'warning' IMHO gets the point, and addresses one of the most critical aspects of Microservices, i.e careful planning and clear documentation about each service's responsability and interactions.
Also, beware that microservices aren't (as usual, in IT) a silver-bullet. They are great when you really need scalability and whenever you need to easily adapt your system to a quickly changing business enviroment - new protocols, new business flows and so on.
Personally, my biggest concern about Microservices is related to eventually consistency you need to adopt when working with microservices. For the kind of project I work on - essentialy, an ERP system - thinking of having several services, each with its own database (at least, in theory), and no real support for distributed transactions....well, don't let me think about it.....
2 weeks ago
Welcome ! This book looks really amazing, thanks for being here.

Peter Rooke wrote:I suspect the BeanFactoryPostProcessor interface is what your are looking for.  
Not sure why you would want to extend the actual framework itself, but it is possible.  

If the OP wants really to do this:

Instead of putting "@PostConstruct" and "@PreDestroy" annotation in all bean class,  l want more generic solution, which is  putting  "@PostConstruct" and "@PreDestroy" annotation in
"Configuration" class than expect to work this two methods for all bean classes.

then creating one's one BeanPostProcessorBean could be a good idea. I was thinking about using a class hierarchy - if you want to use the very same method for doing something, one should put in a single ancestor class the required code.
4 weeks ago

salih ayan wrote:hi Stephan  ...
What l am want to do ?
Instead of putting "@PostConstruct" and "@PreDestroy" annotation in all bean class,  l want more generic solution, which is  putting  "@PostConstruct" and "@PreDestroy" annotation in
"Configuration" class than expect to work this two methods for all bean classes.

That's not the way Spring beans' lifecycle works.
@PreDestroy and @PostConstruct are applied only to the methods annotated with them, within a specific class.

You may want to define a common ancestor class, with @PreDestroy and @PostConstruct annotated methods, and let your managed beans extend it.

1 month ago

Al Hobbs wrote:
Writing the server side in javascript because the frontend is also javascript doesn't really make sense.

With a bold name, such applications are called "isomorphic applications".
Honestly, I think that Tim's comment is correct: most of times, decision about which language to use for a project is driver by skill of already hired people.

Bruno Melloni wrote:
- Since all of the embedded Tomcat instances will use the same version, is it possible for them to share the Tomcat code even as they have independent memory spaces for the apps?  It seems wasteful to load so many copies of the same read-only thing.  Same thing for Java itself, it would be even crazier to have to include a separate copy of Java for each webapp.
- What is the best way to deploy?  Googling seems to point to using a container, and more specifically to deploy the embedded Tomcat Spring Boot apps on Docker.

- Is Docker included in the Windows Server license?  Googling seems to hint so... but it is not clear.

I apologize if these are truly noob questions but google did not help, if anything it added to the confusion as every tutorial seems to be lobbying to sell you a tool instead of helping you choose the best fit.

Also, if going the Spring Boot way is overkill... please say so.  Simpler is always better, if there is such a way.

Spring Boot aims to be a self-contained java application, with every dependency packaged into a single, fat jar file. Including Tomcat runtime as Web Application Server, or Jetty, if you tell Spring Boot to use it. Jetty should have a reduced memory footprint with respect to Tomcat, but there's no huge saving in term of memory. If you deploy your applications as standalone boot application, you'll end to have n Tomcat runtimes  running all together on your server. So, yes, IMHO your concerns are right, things may be even worse with respect to memory consumption. On the other hand, splitting a monolithic installation in several, separated standalone apps will bring undoubtly some advantages: there would be nothing like a "general crash" of all your apps, because each of them work separately.
When dealing with Spring Boot applications, Docker is definitely a way to go. It's quite simple to dockerize a spring boot application, and there are plenty of tutorials on the way teaching you  how to proceed. You won't save memory anyway - a containerized application requires the same memory as before.
With docker, anyway, it's really much more simple to manage your running application and to set-up them to automatically restart if any crashes.
About licenses: AFAIK, Docker community edition is free for use. Don't know anything about Enterprise edition, which I suppose will required a regulard, paid subscriptions.
But for a starter, using CE editoin should be enough.

1 month ago

Neil Barton wrote:Thanks Again Claude,
I found some code using the hikari library and got it working. Whilst implementing it I tidied up the DB access code and closed the leakage which became fairly obvious! The code now runs about 3 times as fast and that's before I try different numbers of connections to optimise it. Excellent, thanks!

Glad it helped !
Using a ConnectionPool is undoubtedly good idea, but not for the reasons you're talking about. If you run in a socket exhaustion, most likely you have severe connection leaks here or there in your code, and using a pool won't help.
A connection pool, indeed, should be used to save opening phisical connection time. If there are connection leaks, you'll  run out of available connections in the pool.
So, first check if in your code there are no leaks.
This said, I don't understand the requirement about not to use Eclipse or Maven. I guess you need a simple jar you need to add to your project's classpath, without using Maven.
If that's true, try with Hikary connection pool - just google for it, and you'll find a lot of examples.
Last, but not least, please remember that "general" connection pool libraries work together with specific DBMS driver. In your example, looks like you're trying to use UniversalConnectionPoolManager  with MySql driver.
UniversalConnectionPoolManager seems to be the specific datasource implementation for Oracle DBMS, not a generic wrapper like Hikary.
My humble advice: have a look at some examples on the web (hikary + mysql), grab the underlaying concepts, and then go further.
Java built-in serialization mechanism will serialize the whole object graph, skipping anything declared as transient.
Just serialize the arrayList of people: related hobbies instances will be serialized as well.
Anyway, remember that serialization isn't a reliable persistence mechanism: you must not use serialization to store persistent data; use DBMS (NO SQL or SQL based) instead.
2 months ago
When a developer is comfortable and productive with the languages and the tools he or she is used to use, it's hard to convince him or her that something else is better, even when this 'something else' is an enhanced version of the beloved programming language. This is a rule I never found an exception for. Personally, I never falled in love with JavaScript, mainly for the lack of a strong typing system; and I confess I started to approach Angular when I read that TS is the preferred language, so I could start doing some serious web interface without the mess of JavaScript.
But I'm also perfectly aware that a seasoned, skilled JavaScript developer could laugh at such consideration - for example, arguing that the mess is only for n the way I write JavaScript code, not in the language itself.
And I couldn't reply anything.
If you are comfortable with Scala, why not? Pillars of Machine learning are mathematics, models and algorithms, not the language you use to work with frameworks like spark.
A batch script is a viable solution. Moreover, how many runtimes do you need to switch ? Java divides between before Java 8 and after Java 8, using JDKs 11,12,13,or 14 should be pretty much the same.
2 months ago

Tim Moores wrote:GWT is dead, IMO. A few people are still hacking away on it, but that looks more like life support to me than anything else. The last dot release was 2.5y ago, and the last major release 3.5y.

If this kind of Java-centric web development appeals to you, check out Apache Tapestry and Apache Wicket, but in general, the world has passed by this approach in favor of SPAs implemented using JavaScript frameworks such as Angular, React or Vue.js.

Totally agree. I think that GWT had its chance years ago when was relative difficult to create webapps that could compete with desktop apps, but nowadays it's mostly a dead end.
Ok, added a flag to this thread, let's see if someone else out there wants to join the discussion.
2 months ago