Author Archives: fvb

Batching in Hibernate

https://docs.jboss.org/hibernate/orm/3.3/reference/en/html/batch.html https://abramsm.wordpress.com/2008/04/23/hibernate-batch-processing-why-you-may-not-be-using-it-even-if-you-think-you-are/   Most people who use batch probably find out about it by trying to perform a large operation and finding out the hard way why batching is needed. They run out of memory. Once this is resolved they assume that batching is working properly. The problem is that even if you are flushing […]

Read more

Logging adapter for WebLogic

https://docs.oracle.com/cd/E23943_01/web.1111/e13739/logging_services.htm#WLLOG199 To redirect messages from JDK logging system to WebLogic standard log files we need to add special ServletLoggingHandler. logging.properties: # Specify the handlers to create in the root logger handlers = weblogic.logging.ServerLoggingHandler # Register handlers for the com.foo.toyshop and its child loggers com.foo.toyshop.handlers = java.util.logging.ConsoleHandler, weblogic.logging.ServerLoggingHandler # Do not send the toyshop log messages […]

Read more

Java Unsafe

http://mishadoff.com/blog/java-magic-part-4-sun-dot-misc-dot-unsafe/   Java Magic. Part 4: sun.misc.Unsafe Java is a safe programming language and prevents programmer from doing a lot of stupid mistakes, most of which based on memory management. But, there is a way to do such mistakes intentionally, using Unsafe class. This article is a quick overview of sun.misc.Unsafe public API and few […]

Read more

Mondrian and Pivot4J

http://www.drdobbs.com/database/olap4j-online-analytical-processing-for/230800051https://github.com/OSBI/saiku/blob/master/saiku-core/saiku-olap-util/src/main/java/mondrian/olap4j/SaikuMondrianHelper.java

Read more

JPivot analogs

Webpivotable costs not much, works fine, but their design may be better, but thats just for me. Here their demo. icCube – nice team, support, tool totally for OLAP and their webreporting tool is enough for some usual needs, but not more. Regarding futher detailisation, this is not for you. Flexmonster – looks nice, works […]

Read more

Configuring maven

On Windows 7 one may get the following error message: caught when connecting to the target host: Permission denied: connect to fix the problem set “MAVEN_OPTS=-Djava.net.preferIPv4Stack=true” \ in mvn.cmd

Read more

Double-checked locking

https://www.securecoding.cert.org/confluence/display/java/LCK10-J.+Use+a+correct+form+of+the+double-checked+locking+idiom The double-checked locking idiom is a software design pattern used to reduce the overhead of acquiring a lock by first testing the locking criterion without actually acquiring the lock. Double-checked locking improves performance by limiting synchronization to the rare case of computing the field’s value or constructing a new instance for the field to […]

Read more

JDBI

http://www.jdbi.org/ DataSource ds = JdbcConnectionPool.create(“jdbc:h2:mem:test”, “username”, “password”); DBI dbi = new DBI(ds); Handle h = dbi.open(); h.execute(“create table something (id int primary key, name varchar(100))”); h.execute(“insert into something (id, name) values (?, ?)”, 1, “Brian”); String name = h.createQuery(“select name from something where id = :id”) .bind(“id”, 1) .map(StringMapper.FIRST) .first(); assertThat(name, equalTo(“Brian”)); h.close();

Read more

Netty tutorials

http://seeallhearall.blogspot.ru/2012/05/netty-tutorial-part-1-introduction-to.htmlhttp://seeallhearall.blogspot.ru/2012/06/netty-tutorial-part-15-on-channel.html

Read more

Validation JSR-303 benchmarking

http://carinae.net/2010/06/benchmarking-hibernate-validator-and-apache-beanvalidation-the-two-jsr-303-implementations/ Apache BeanValidation Formerly Agimatec Validation, since March 2010 it has migrated to Apache where it is currently under incubation. One of its most useful extra features is the ability to perform method validation using the same kind of JSR-303 annotations. The benchmarked version is: 0.1-incubating. Hibernate Validator The reference implementation of the standard, coming […]

Read more

Purging connections from JDBC connection pool

http://docs.oracle.com/cd/E24329_01/web.1211/e24376/phys_conr.htm#JDBCP1037 http://docs.tpu.ru/docs/oracle/en/fmw/11.1.1.6.0/apirefs.1111/e13941/toc.htm   There are special tasks when we need to explicitly close physical connection to the database: clean errors on the connection for example. General standard solution does not exist but for WebLogic data source we can do the following: 1. Ensure that “Remove Infected Connections Enabled” option is set to true; true is […]

Read more

Configuring SSL for WebLogic managed server

General considerations: https://timtaubert.de/blog/2014/10/deploying-tls-the-hard-way/ To check current SSL/TLS version and cipher suite used for SSL connections: $ openssl s_client -connect hostname:8888 example output: New, TLSv1/SSLv3, Cipher is AES128-SHA Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol  : TLSv1 Cipher    : AES128-SHA Session-ID: 5523B18F98C687FD8E76527F827E86EA47C603C8D105DF1D5428468A83ACA7D5 Session-ID-ctx: Master-Key: 7C2824A28A3722A8072082D6CB69ED3C2D6DA669B7D46E4FC994AFB71150B324A0D55E59569377FF9C93A8DF0DE80BE1 Key-Arg   : […]

Read more

Configuring Java-based Node Manager

Create script for managing Node Manager script: /etc/init.d/nodemgr. Register it as a service start/stop script: #  chkconfig –add nodemgr Now we may start and stop the service as: # service nodemgr start # service nodemgr stop   ———————————————————————————————————————————- #!/bin/sh # # nodemgr Oracle Weblogic NodeManager service # ### BEGIN INIT INFO # Provides: nodemgr # […]

Read more

Configuring Script-based Node Manager

Further it is supposed that WebLogic server is already installed on the machine and domains are configured. Let us take “base_domain” as the domain name in the following example commands. 1. Create OS user > useradd -g bea -m ndmgr > passwd ndmgr add WL_HOME/common/bin to the PATH variable. It is recommended that node manager […]

Read more

JSF: button and commandButton difference

http://stackoverflow.com/questions/13070537/difference-between-hbutton-and-hcommandbutton The <h:button> generates a HTML <input type=”button”> which uses JavaScript to navigate to URL as represented by the given navigation case outcome by a HTTP GET request. E.g. <h:button value=”GET button” outcome=”otherpage” /> will generate <input type=”button” onclick=”window.location.href=’/contextpath/otherpage.xhtml’; return false;” value=”GET button” /> Even though this ends up in a (bookmarkable) URL change in […]

Read more