Tuesday, September 3, 2013

weblog; Hibernate, PostgreSql, Maven, JRuby

Hibernate

Hibernate opening/closing session, the correct approach for DAO

http://stackoverflow.com/questions/8841207/hibernate-opening-closing-session-the-correct-approach-for-dao

Experiencing problems with session, I think. After deleting records from the database, should the session be closed and opened again to stop getting exceptions?

Hibernate Error: a different object with the same identifier value was already associated with the session

http://stackoverflow.com/questions/16246675/hibernate-error-a-different-object-with-the-same-identifier-value-was-already-a

It seems this is where I'm having my current code hangup. Should I be closing the session between deletes and inserts? Or is there something being updated instead and that's throwing exceptions because I'm inadvertently attempting to update a record that has been destroyed in the same session?

PostgreSql

PostgreSQL: Get the second to last MAX(date)

http://stackoverflow.com/questions/16567632/postgresql-get-the-second-to-last-maxdate

Maven

Maven: Filtering the dependency tree

http://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html http://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html
mvn dependency:tree -Dincludes=velocity:velocity
mvn dependency:tree -Dverbose -Dincludes=commons-collections

I used this to resolve issues I was experiencing with log jars. I was including a version of one collection of jars. Another resource was pulling them in too, only a different version. This was raising some warnings anytime I ran maven. I used a call like this one to figure our where my conflicts existed.

JRuby

JRuby and Java Code Examples

https://github.com/jruby/jruby/wiki/JRubyAndJavaCodeExamples

How to call Ruby from Java code and Java from Ruby code.

JRuby limited openssl loaded - how to eliminate?

http://stackoverflow.com/questions/9017412/jruby-limited-openssl-loaded-how-to-eliminate

Moving an Existing Rails App to run on JRuby: Install JRuby locally

https://devcenter.heroku.com/articles/moving-an-existing-rails-app-to-run-on-jruby#specify-jruby-in-your-gemfile

Best way of invoking getter by reflection

http://stackoverflow.com/questions/2638590/best-way-of-invoking-getter-by-reflection

While trying to come up with my own testing utility for stubbing/mocking, I found this. Could be a good read, but I reverted back to JMockit.

Maven: Filtering the dependency tree http://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html

Call JRuby, Jython or other JVM scripting language from Maven

http://matschaffer.com/2009/10/call-jruby-jython-from-maven/
  <executions>
    <execution>
      <id>my_script</id>
      <phase>compile</phase>
      <configuration>
        <tasks>
          <java classname="org.jruby.Main" failonerror="yes">
            <arg value="${basedir}/src/main/ruby/myscript.rb" />
          </java>
        </tasks>
      </configuration>
    </execution>
  </executions>

Guide to installing 3rd party JARs

http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
mvn install:install-file -Dfile=<path-to-file> -DgroupId=<group-id> \
    -DartifactId=<artifact-id> -Dversion=<version> -Dpackaging=<packaging>

Using JRuby with Maven

https://github.com/jruby/jruby/wiki/Using-JRuby-with-Maven
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-core</artifactId>
      <version>1.7.0.RC1</version>
    </dependency>

No comments:

Post a Comment