I want to implement Container Managed persistence using Websphere and OpenJPA.
Can anyone provide some insights ?
Is there a way to achieve this without using EJB3 or Spring ?
EJBs and Spring (along with some other Dependency Injection frameworks like Google Guice) implement the Container Managed EntityManager. If you don't want to use the technology that provides the hooks for the container to handle the transactions and entity managers for you, then you would have to roll your own which is the application managed route.
Related
I am new to gRPC and I am building a microservice application using Spring Boot. The plan is to use gRPC to create shared entity classes across the microservices. I would like to ask, are the classes generated by gRPC annotated with #Entity annotation and other JPA annotations?
If the above is possible, will I also be able to selectively choose to exclude the JPA annotations? this is because some microservices do not need the entity of other microservices.
Furthermore, what are the best practices for gRPC in Spring Boot? E.g. the libraries available etc.
I was trying to implement an OSGi application , application has servlet(implemented using jetty), jaxb(using eclipselink moxy), and Jpa part(the problem part). I was trying to use eclipselink inside apache felix container for jpa functionality, I tried various approach but couldn't implement it. I just need some working example or tutorial link.
The easiest way to use jpa in felix is to use Apache Karaf as it has pre packaged features for eclipselink as well as Aries JPA which makes it easier to use any jpa provider in OSGi.
See example with declarative services, or with blueprint.
For plain felix I recommend to use bndtools to get the list of bundles and also to be able to directly run felix.
I started a tutorial to package and run the tasklist-ds example using bndtools
Had anybody attempted to use MyBatis as their persistence library for a JBoss 7.1 /Java EE6 application?
I'm wondering what are the best approaches to handling connections, transations, rollbacks etc?
How about CDI support? Looking around online it seems at this time MyBatis only supports two Dependency Injection (JSR-330) frameworks, Google Guice and Spring. I did run into CDI Extensions which may be something look into.
My idea would be to have the container handle all of the above however it may be difficult getting to that point.
Any tips, hints, experiences?
There is a new mybatis-cdi module. It is not released yet, but you can try the snapshot, it is at github: https://github.com/mybatis/cdi
There is no CDI support at all but as you said, if you want DI go Spring or Guice.
With JBoss you have mainly two chances:
- EJB 3
- Spring
If using EJB 3 transactions are handled automatically by them. MyBatis just ignores transactions and lets the container commit/rollback.
When using Spring, MyBatis ties to Spring transactions using the integration module MyBatis-Spring.
I would create my own CDI bean - use #Produces for a factory, and #Inject to get the session.
Here is old iBatis Spring factory, that might be the producer, after some changes:
SqlMapClientFactoryBean
Can Spring Data Neo4j be used "standalone" (i.e. outside Spring container) like Spring Data JPA can?
Currently you cannot use Spring Data Neo4j outside of a Spring Container as it does not integrate with the CDI integration support in Spring Data Commons yet.
Feel free to open a JIRA issue if you'd like to see support for that.
Spring Roo + GWT is very exciting but I'd like to use an existing Web Service as a backend so I was wondering if there is any way to configure Roo to use a WSDL as the starting point rather than the entity description (and have it wire in the Jax-WS calls to the service).
Thanks!
As far as I know Spring Roo do not have support for this yet.