Questions tagged [guice-persist]

Guice Persist provides abstractions for working with datastores and persistence providers in Guice applications. It works in a normal Java desktop or server application, inside a plain Servlet environment, or even a Java EE container.

Guice Persist provides abstractions for working with datastores and persistence providers in your Guice applications. It works in a normal Java desktop or server application, inside a plain Servlet environment, or even a Java EE container.

Guice Persist supports a simple approach to transactions and various unit-of-work semantics; both with the same declarative, annotation-based API. Switching between unit-of-work strategies is as simple as changing a configuration option.

It also follows the Guice idioms of using simple, expressive configuration and tries to remain type-safe as far as possible.

http://code.google.com/p/google-guice/wiki/GuicePersist

55 questions
2
votes
1 answer

TransactionRequiredException: no transaction is in progress with Jersey + Guice + JPA

Using Guice 3.0, following this tutorial: https://code.google.com/p/google-guice/wiki/JPA GuiceModule class: public class GuiceModule extends ServletModule { @Override protected void configureServlets() { // start the service …
AndresQ
  • 763
  • 4
  • 17
2
votes
1 answer

Trouble using Guice Persist together with JTA / bitronix

We have an existing j2se project that already uses JPA and guice-persist. Now, because we want to add JMS functionality, there is a request for 2-phase-commit and JTA. We'll use the bitronix transaction manager because there's no container (like…
Andreas Dolk
  • 108,221
  • 16
  • 168
  • 253
2
votes
1 answer

How to inject service to hibernate.ejb.interceptor with google guice?

I have an issue with injecting a service to predefined interceptor using google guice. What i'm trying to do is to use emptyinterceptor to intercept changes with entities. Interceptor itself works fine, the problem is that I can't figure out how to…
Kirstein
  • 863
  • 8
  • 10
2
votes
1 answer

Guice-Persist: Attempting to execute an operation on a closed EntityManager

I have an app managed by maven with two modules: one for persistence, and another for the webapp itself (gwt). My tests in persistence module works like a charm, but, in webapp, when I execute the same method multiple times I got a…
caarlos0
  • 18,163
  • 21
  • 76
  • 144
2
votes
2 answers

JPA2 + Hibernate + Guice-persist: Version Behavior

I using Hibernate 3.6 Final, Guice-persist and JPA2. So good, I have everything configured, and my bean has a @Version private Long version;, with getter and setter. I have implemented equals and hashcode with all the fields. My dao save method is…
caarlos0
  • 18,163
  • 21
  • 76
  • 144
1
vote
2 answers

How to commit the current guice-persist UnitOfWork?

I'm using a UnitOfWork in a background task method (operated by Quartz) with Guice-persist on top of hibernate. The background task call a service, which need to commit the current transaction in the middle of it's task - and continue on another…
Laurent Grégoire
  • 3,724
  • 26
  • 48
1
vote
1 answer

How to configure read only transaction in GET request with Guice and Jersey?

I am using Guice, Guice Persist, Hibernate and Jersey. All my resource methods are annotated with @Transactional except for the methods that are annotated with @GET. Is this the correct way configure the transaction-per-request scope?
GuidoMB
  • 2,001
  • 2
  • 24
  • 38
1
vote
1 answer

Hibernate: Unable to locate persister: java.math.BigDecimal

I am trying to combine guice, jpa and hibernate. The initialization of hibernate looks good, until i try to access a mapped class trough a DAO. I found all the help requests, but my problem is (for now) not a "custom-class" (at least I dont think…
semTex
  • 343
  • 4
  • 16
1
vote
1 answer

Restlet implementation with Guice

Java development took a huge step forward with the introduction of Guice. My projects heavily depend on Warp-persist and its successor GuicePersist for persistency. But there seems to be a mismatch between the use of Guice and Restlet. It looks like…
Roland Beuker
  • 316
  • 1
  • 13
1
vote
1 answer

Extending Guice JPA support to provide transaction hooks

I find myself needing a post commit hook on transactions. I am using an event store and need to guarantee that events are not published until the transaction has been committed, because an event handler might require data from the previous…
Alex Edwards
  • 1,533
  • 2
  • 21
  • 47
1
vote
1 answer

Guice JpaRepositoryModule with multiple Persistence Units

I've declared my 2 PUs on persistence.xml as below: org.hibernate.ejb.HibernatePersistence
1
vote
1 answer

JPA @ElementCollection mysteriously cached

My POJO (named Category) have a langMap (Language Map) , which stores Locale -> String mapping. It's defined as : @Entity class Category implements Serializable { @ElementCollection @MapKeyColumn(name = "locale") @Column(name = "name") …
smallufo
  • 10,110
  • 19
  • 64
  • 101
1
vote
1 answer

JPA 2 + EclipseLink : Caching Issue

I have a strange behavior with caching and JPA Entities (EclipseLink 2.4.1 ) + GUICE PERSIST I will not use caching, nevertheless I get randomly an old instance that has already changed in MySQL database. I have tried the following: Add @…
Azimuts
  • 1,102
  • 3
  • 14
  • 33
1
vote
0 answers

Update to entity is not recognized or persisted when using guice-persist

I am having an issue with guice-persist and guice-servlet (http-request scoped jpa sessions) where I attempt to update an entity's value and persist that update, but the update is never persisted to the database. I have tried forcing the write with…
1
vote
1 answer

Guice-JPA persistance.xml not reading placeholders from properties file

I m using Guice-JPA module with hibernate to perform the DAO operations. When hard coding the connection information in persistence.xml, everything works fine. but when I try to use properties file for connection parameters, persistence.xml just…
Sammy
  • 4,388
  • 8
  • 29
  • 52