Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓
Streaming data changes, one at a time.

Gunnar Morling gunnarmorling

🤓
Streaming data changes, one at a time.
View GitHub Profile
View CallerProvider.java
public class CallerProvider extends SecurityManager {
public Class<?> getCallerClass() {
return getClassContext()[2];
}
}
View gist:8bd6d5b4569eaa923cbe
# 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
View gist:ba193caecb7d5cdbd0a4
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
View deps.java
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 Aug 29, 2015
OGM-465 Error handling SPI
View UC-1
// 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
View gradle.log
➜ 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 Aug 29, 2015
GreaseMonkey script for rendering source and target branches of GitHub PRs as links
View github_pr_branch_links.user.js
View several_id_fields.java
@Id
@DocumentId
@NumericField(forField="id_forNumericSort")
@Field(name = "id_forNumericSort", store=Store.NO, index=Index.NO)
public Integer getId() {
return id;
}
View 01_sorting_simple.java
@Field(analyzed=Analyze.NO)
@SortField
public String getLastname() {
return lastname;
}
View NumericFieldTest.java
@Indexed
public class PointOfInterest {
@Id
@DocumentId
@Field(name = "myId")
@NumericField
private byte id;
...