Skip to content

Instantly share code, notes, and snippets.

View gunnarmorling's full-sized avatar
🤓
Streaming data changes, one at a time.

Gunnar Morling gunnarmorling

🤓
Streaming data changes, one at a time.
View GitHub Profile
public class CallerProvider extends SecurityManager {
public Class<?> getCallerClass() {
return getClassContext()[2];
}
}
@gunnarmorling
gunnarmorling / gist:8bd6d5b4569eaa923cbe
Created November 4, 2014 15:59
URLConstraintBenchmark
# Run complete. Total time: 00:00:20
Benchmark (url) Mode Samples Score Error Units
o.h.v.URLConstraintBenchmark.measureValidationUsingRegExp http://foo.com/blah_blah ss 300 580,450 ± 100,057 us
o.h.v.URLConstraintBenchmark.measureValidationUsingRegExp http://142.42.1.1:8080/ ss 300 575,237 ± 99,833 us
o.h.v.URLConstraintBenchmark.measureValidationUsingRegExp http://例子.测试 ss 300 454,633 ± 50,617 us
o.h.v.URLConstraintBenchmark.measureValidationUsingRegExp http//foo/ ss 300 181,290 ± 15,749 us
o.h.v.URLConstraintBenchmark.measureValidationUsingRegExp ///a ss 300 86,680 ± 17,834 us
o.h.v.URLConstraintBenchmark.measureValidationUsingRegExp :// should fail ss 300 80,807 ± 11,059 us
o.h.v.URLConstraintBenchmark.measureValid
javax.persistence.PersistenceException: org.hibernate.engine.transaction.jta.platform.spi.JtaPlatformException: Could not obtain JBoss Transactions transaction manager instance
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1771)
at org.hibernate.jpa.internal.EntityManagerImpl.isOpen(EntityManagerImpl.java:170)
at org.hibernate.jpa.internal.EntityManagerImpl.checkOpen(EntityManagerImpl.java:101)
at org.hibernate.jpa.internal.EntityManagerImpl.checkOpen(EntityManagerImpl.java:96)
at org.hibernate.jpa.internal.EntityManagerImpl.getSession(EntityManagerImpl.java:111)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.setDefaultProperties(AbstractEntityManagerImpl.java:308)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.postInit(AbstractEntityManagerIm
File[] files = Maven.resolver()
.resolve( "org.apache.avro:avro:jar:1.7.6" )
.withTransitivity()
.asFile();
System.out.println( Arrays.toString( files ) );
@gunnarmorling
gunnarmorling / UC-1
Last active August 29, 2015 14:16
OGM-465 Error handling SPI
// UC-1: As a user of OGM, upon an exception during flush(), I want to log all operations applied so far and abort the
// processing of the flush cycle
➜ hibernate-orm git:(HHH-9708) ✗ ./gradlew clean compileJava
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
@gunnarmorling
gunnarmorling / github_pr_branch_links.user.js
Last active August 29, 2015 14:24
GreaseMonkey script for rendering source and target branches of GitHub PRs as links
@Id
@DocumentId
@NumericField(forField="id_forNumericSort")
@Field(name = "id_forNumericSort", store=Store.NO, index=Index.NO)
public Integer getId() {
return id;
}
@Field(analyzed=Analyze.NO)
@SortField
public String getLastname() {
return lastname;
}
@Indexed
public class PointOfInterest {
@Id
@DocumentId
@Field(name = "myId")
@NumericField
private byte id;
...