xpam.pl

Month: December 2016

  • Expose your dev machine to the public via reverse SSH tunnel

    Scenario: you are creating a REST service which needs to be exposed to the public even in early stage of development due to an upstream provider which sends back feedback data from a webhook API. You are also behind a NAT so you’d have to port forward yourself out but you can’t do that for…

  • OJDBC7 in a Docker container? Prepare for trouble

    Scenario: A JDK8 Docker container using OJDBC7 to connect to the database. Sounds simple enough, what could go wrong? Simptoms: Connecting to the database randomly takes several minutes, fails with a weird SqlRecoverableException: no more data to read from socket or just works fine as if there is no problem. The same Docker image also…

  • JPQL: getting whole entities on a distinct column

    If you want distinct entities in JPQL you would normally write something like this: SELECT DISTINCT(l) FROM Letter l WHERE l.name=:name; But this will do a DISTINCT on the whole Entity. This will also fail on Oracle DB if your Entity contains a CLOB. What if you really want to do a DISTINCT on a…