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
@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 deps.java
File[] files = Maven.resolver()
.resolve( "org.apache.avro:avro:jar:1.7.6" )
.withTransitivity()
.asFile();
System.out.println( Arrays.toString( files ) );
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 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 CallerProvider.java
public class CallerProvider extends SecurityManager {
public Class<?> getCallerClass() {
return getClassContext()[2];
}
}
View OgmPersistEventListener.java
private static class OgmPersistEventListener extends DefaultPersistEventListener {
/**
* Performs all the actual work needed to save an entity (well to get the save moved to
* the execution queue).
*
* @param entity The entity to be saved
* @param key The id to be used for saving the entity (or null, in the case of identity columns)
* @param persister The entity's persister instance.
* @param useIdentityColumn Should an identity column be used for id generation?
View Court.java
@Entity
public class Court {
@EmbeddedId
private CourtId id;
private String name;
@OneToMany(mappedBy = "playedOn")
private Set<Game> games = new HashSet<Game>();
@gunnarmorling
gunnarmorling / gist:fa6eb9ab72fff2d5a8d1
Created Sep 5, 2014
IMPL types exposed by HSEARCH API/SPIs
View gist:fa6eb9ab72fff2d5a8d1
[ERROR] my-rules:PublicMethodsMayNotExposeInternalTypes: API/SPI methods must not expose internal types.
[ERROR] method=org.hibernate.search.engine.spi.SearchFactoryImplementor#org.hibernate.search.engine.impl.FilterDef getFilterDefinition(java.lang.String)
[ERROR] method=org.hibernate.search.engine.spi.SearchFactoryImplementor#org.hibernate.search.indexes.impl.IndexManagerHolder getIndexManagerHolder()
[ERROR] method=org.hibernate.search.engine.spi.SearchFactoryImplementor#org.hibernate.search.backend.impl.batch.BatchBackend makeBatchBackend(org.hibernate.search.batchindexing.MassIndexerProgressMonitor)
[ERROR] method=org.hibernate.search.engine.spi.EntityIndexBinding#org.hibernate.search.query.collector.impl.FieldCacheCollectorFactory getIdFieldCacheCollectionFactory()
[ERROR] method=org.hibernate.search.engine.spi.DocumentBuilderIndexedEntity#org.hibernate.search.query.collector.impl.FieldCacheCollectorFactory getIdFieldCacheCollectionFactory()
[ERROR] method=org.hibernate.search.engine.spi.Abs
@gunnarmorling
gunnarmorling / Actual_Persisted_Format.json
Last active Aug 29, 2015
Persisted format of OneToOneTest#testBidirectionalManyToOne() in MongoDB
View Actual_Persisted_Format.json
{
"_id" : "6866afaf-c5ee-4fee-9821-79b2ae2a63b7",
"husband" : [
"ae25fe38-d532-415c-b12a-4c1f0f4782a8"
],
"name" : "Bea"
}
{
"_id" : "ae25fe38-d532-415c-b12a-4c1f0f4782a8",
"name" : "Alex",
@gunnarmorling
gunnarmorling / 4.1.0.Beta6.md
Last active Aug 29, 2015
Query improvements and better Neo4j support - Hibernate OGM 4.1.0.Beta6 is out
View 4.1.0.Beta6.md

The Hibernate team is very happy to announce the release of another Beta of Hibernate OGM 4.1!

Progress has been made with respect to query execution and the Neo4j dialect. Also we do provide a so-called "Bill of Materials" POM now which the Maven users out there will appreciate (details below).

The GAV coordinates to be used with Maven, Gradle etc. are:

  • org.hibernate.ogm:hibernate-ogm-core:4.1.0.Beta6 for the OGM engine and
  • org.hibernate.ogm:hibernate-ogm-:4.1.0.Beta6, depending on the backend you want to use.

Alternatively you can fetch a release bundle containing Hibernate OGM and all its dependencies from SourceForge.

You can’t perform that action at this time.