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
1
vote
2 answers

JPA & Guice-persist: permanently opened connection issue?

Using Hibernate, c3p0, Guice and Guice-persist, we have strange issues with the fact that the connections to the data are not released to the pool after transactions. It seems that it's related to the way JpaPersistService is done, caching the…
cporte
  • 2,071
  • 3
  • 17
  • 30
1
vote
1 answer

What are the implications of running a query against a MySQL database via Hibernate without starting a transaction?

It seems to me that we have some code that is not starting a transaction yet for read-only operations our queries via JPA/Hibernate as well as straight SQL seem to work. A hibernate/jpa session would have been opened by our framework but for a few…
benstpierre
  • 30,487
  • 46
  • 163
  • 272
0
votes
1 answer

Google guice persist throws error No Persistence provider for EntityManager named test

Hi I searched the web but only find insufficient results. I be happy if you point me to a site that helps. I try to start google guice with guice persist but keep getting the error that No Persistence provider for EntityManager named test is…
0
votes
1 answer

How to debug Guice class/method interceptors?

I'm trying to use guice-persist and I can't get it to work in a simple test case. This a generic request handler which is getting called from a dispatcher: public abstract class TransactionAwareRequestHandler extends SyncRequestHandler { …
Aaron Digulla
  • 297,790
  • 101
  • 558
  • 777
0
votes
0 answers

How to bind an interface to multiple implementation classes in Guice

I have an interface called DAOInterface which has methods like create(), update(), read() and delete(). Also, I have an abstract class AbstractDAO implementing the DAOInterface which has empty method definitions. Now, I created two new classes…
0
votes
1 answer

How to prevent reuse of EntityManager with guice-persist and @Transactional?

According to this question, when using guice-persist, EntityManager is transaction-scoped. If I understand correctly, this means that a new EntityManager will be created for every transaction. When using guice-persist, it is suggested to use…
Danilo Radenovic
  • 999
  • 1
  • 9
  • 22
0
votes
0 answers

java.lang.IllegalStateException: Unable to load cache item

The above exception is thrown from a unit test when I add Java modularity to my project. I cannot find a solution to this exception. I have added to MAVEN_OPTS --add-opens java.base/java.lang=ALL-UNNAMED And the same in the configuration of the…
0
votes
1 answer

Guice Persist with multiple persistence units

I have setup guice with multiple persistence units, but the problem I have is that I'd prefer to have a default instead of having to explicitly declare one or the other. When I want the "other" one, I will explicitly ask for it. When I want the…
Walter
  • 1,068
  • 1
  • 15
  • 37
0
votes
0 answers

Batch size not working with Google Guice + JPA + Hibernate

I am using Google Guice as dependency injection and Transaction purpose along with JPA and Hibernate. I have added in my persistence.xml file. Here is my save entity list DAO code…
Badman
  • 367
  • 2
  • 13
0
votes
1 answer

Hibernate and Guice without persistence.xml

I am trying to find a way to use Guice 4.1 and Hibernate 5.2 I checked the documentation and seems like we need to use a persistence.xml file. I am wondering if we can use Guice and Hibernate without this persistence.xml? is there a way to do what…
AnthonyC
  • 247
  • 5
  • 16
0
votes
1 answer

Inject a Hibernate Interceptor with Guice / GuicePersist

I'm using JPA with Guice Persist for my GAE projects and Restlet for the REST interface. Under the hood good old Hibernate delivers the JPA service. This works like a charm, and Guice injects necessary JPA parts into my classes, for example an…
Roland Beuker
  • 316
  • 1
  • 13
0
votes
1 answer

guice - @Transactional - not working

I am using guice 4.1 along with the persist extension and hoping that @Transactional will work, but it isn't. I followed the wiki and read this post, but to no avail: Managing transactions in JavaSE with Hibernate and Guice Just to re-iterate ... I…
Walter
  • 1,068
  • 1
  • 15
  • 37
0
votes
1 answer

Join multiple persistence.xml files together

I am using guice persist which relies on me listing my persistence units in a persistence.xml. As far as I can tell, there is no way to pass PersistenceUnitInfo at runtime to guice-persist. However, where I have multiple databases, I have the…
Cheetah
  • 12,515
  • 28
  • 93
  • 167
0
votes
1 answer

Implementation of Google guice does not work

I am a beginner lerner of Google guice. I have programmed like below to insert in Oracle and postgres db, I have posted a very simple coede here but, when I run this I am getting an error as Exception in thread "main"…
New Bee
  • 138
  • 7
0
votes
2 answers

Recovering from broken database connection with hibernate

I am having trouble recovering from a broken database connection. My test case uses the following libraries. guice-persist 4.0 Hibernate core 4.3.1 HikariCP-java6-2.3.9 (connection pool). My test runs a simple read in a loop with a small sleep…
user2046211
  • 316
  • 1
  • 4
  • 20