A JVM benchmark example from real project (QuickFIX/J is library that implements finacial FIX protocol) https://github.com/quickfix-j/quickfixj/wiki/JMH-benchmark-for-%2339-and-%2342
Tuesday, 26 June 2018
Saturday, 24 March 2018
Log4j not printing the stacktrace for exception
I've noticed interesting behavior in the server logs on jdk 8. There was an exception without stack trace. After small research I have found that hotspot may apply some optimization to exceptions that are thrown too frequent, it simply trim stack trace) So I scrolled to the first occurrences of the exception and found my stack trace. Here is oracle docs describing it:
http://www.oracle.com/technetwork/java/javase/relnotes-139183.html
and you can disable it with -XX:-OmitStackTraceInFastThrow
http://www.oracle.com/technetwork/java/javase/relnotes-139183.html
and you can disable it with -XX:-OmitStackTraceInFastThrow
Sunday, 17 September 2017
Spring 5 and HSQLDB sample app
Recently I have played a bit with Spring 5 and embedded database HSQLDB. It is very not usual for me to create Spring app even without single xml. Also I used cool library called Lombok it provides auto getter/setter generation.
What was interesting for me that spring-boot auto configure for you following features: mvc, transactions, json serialization, jpa, tests. It has even embedded tomcat)
Here is my github repository
Sunday, 2 July 2017
Sunday, 25 June 2017
Machine learning
Choosing the right estimator
http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html
https://www.dropbox.com/s/nz2d6uquwn59fz6/ml_map.png
later i will add here more machine learning stuff
Первые шаги в машинном обучении
Machine Learning is Fun! The world’s easiest introduction to Machine Learning
https://oracle.github.io/graphpipe/#/
https://github.com/neomatrix369/awesome-ai-ml-dl
http://scikit-learn.org/stable/tutorial/machine_learning_map/index.html
https://www.dropbox.com/s/nz2d6uquwn59fz6/ml_map.png
later i will add here more machine learning stuff
Первые шаги в машинном обучении
Machine Learning is Fun! The world’s easiest introduction to Machine Learning
https://oracle.github.io/graphpipe/#/
https://github.com/neomatrix369/awesome-ai-ml-dl
Thursday, 15 June 2017
A different object with the same identifier value was already associated with the session
Hibernate Error: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session
What is the reason of such exception?
Session already contains object that you are trying to put there one more time with such identifier (for example with update). It also could be many-to-one or one-to-many relationship object or cascading operation.
How to deal with it?
What is the reason of such exception?
Session already contains object that you are trying to put there one more time with such identifier (for example with update). It also could be many-to-one or one-to-many relationship object or cascading operation.
How to deal with it?
- probably you already called update() for this object, and trying do this 2nd time
- another possible reason you making copy of the object that is already associated with session (has assigned id and was loaded recently) and trying to update it
- try session.merge() - it will copy the state of the given object into the persistent object with the same identifier.
- try session.evict(object) - remove this instance from the session cache.
Sunday, 11 June 2017
Domain Driven Design in Java
I think most enterprise java world is suffering from Anemic Domain Model. One of the ways that can help you is DDD. I've started researching DDD area, and I've found couple of good books and sources for them:
Implementing Domain-Driven Design by Vaughn Vernon (I think it is good to start book)
and source code is here : https://github.com/VaughnVernon/IDDD_Samples
And one more book called Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans
and source code is here: https://github.com/citerus/dddsample-core
more code samples https://github.com/ddd-by-examples/library
https://github.com/mploed/ddd-with-spring
Implementing Domain-Driven Design by Vaughn Vernon (I think it is good to start book)
and source code is here : https://github.com/VaughnVernon/IDDD_Samples
And one more book called Domain-Driven Design: Tackling Complexity in the Heart of Software by Eric Evans
and source code is here: https://github.com/citerus/dddsample-core
more code samples https://github.com/ddd-by-examples/library
https://github.com/mploed/ddd-with-spring
Subscribe to:
Posts (Atom)