Questions tagged [stateless-session]
45 questions
3
votes
1 answer
Nhibernate StatelessSession and Lazy Loading
I recently tried to develope a "SessionWrapper". The idea behind it was to be able to switch from a Stateful Session to a Stateless Session easily, with no modifications to the DAOs and the XML mapping files.
Mapping looks like this:

Pierre Murasso
- 591
- 7
- 14
3
votes
2 answers
What are best practices to send user credentials with stateless services (REST-services)?
What are best practices when it comes to sending user credentials to stateless services (Let's say ASP.NET Web Api's).
What should be done when SSL is not an option?
And is it safe to send user credentials in URL parameters (with or without…

janine doedel
- 31
- 6
2
votes
1 answer
NHibernate Saving a Collection via a StatelessSession
I have 2 classes that have a many-to-many collection of each other mapped within the class.
Here is a simplified mapping of my two classes:
Vehicle:

Nathan Raley
- 455
- 1
- 7
- 16
2
votes
0 answers
CAS & spring-security-cas with stateless session
I'm currently working through a spring application which is using stateless session and JWT based mechanism for authentication & authorizations.
A new requirement arrived: using CAS v4.0 SSO solution to replace the authentication system. I went…

R. G
- 257
- 2
- 14
2
votes
2 answers
StatelessSession being cast to Session in AbstractEntityPersister (Hibernate)
I'm trying to do a simple save on a StatelessSession. Can someone spot what I'm doing wrong to end up in the Hibernate method that tries to do an invalid cast of StatelessSession to Session. I would appreciate any feedback.
My example code:
…

longtimer
- 21
- 3
2
votes
0 answers
Grails spring security rest plugin v1.5.3 - Refresh token flow
I have a REST API implemented using grails v2.5.2 and a client using AngularJS. I am using the JWT authentication that the plugin provides by default.
I've set the token expiration as 3600 and I would like to refresh the access_token automatically…

Fernando Buccella
- 59
- 1
- 5
2
votes
1 answer
Spring + Hibernate, how to close a StatelessSession?
Normally, we use Spring + Atomikos to manage the JTA sessions and set hibernate.auto_close_session to true.
Now, if we manually open a stateless session (for some async job) as:
StatelessSession sl = sessionFactory.openStatelessSession();
How do we…

daole
- 183
- 10
1
vote
1 answer
Drools 7: Getting 'Rule Compilation error' when trying to load classes and rules at runtime
I am trying to Load the class using my custom class loader and create rule for the loaded class
public class DynamicClassLoader extends DynamicProjectClassLoader {
private static DynamicClassLoader instance;
public static…

Ramit Kovvalpurail
- 31
- 4
1
vote
1 answer
Updating an entity and ignore child proxies when using NHibernate StatelessSession
I'm trying to bulk-update entities using a StatelessSession.
Because it's stateless, NHibernate doesn't auto-cascade child entities upon save.
This is fine because I don't want to make any changes to any of the child entities.
Unfortunately, upon…

Chris Haines
- 6,445
- 5
- 49
- 62
1
vote
0 answers
How to store state client side for chained micro services
I'd like to store microservice state client side. For a single service it seems fairly straight forward how to achieve this (return an attribute in the HTTP body for the state). However things get more complicated with chained services.
In the…

Person of earth
- 71
- 1
- 8
1
vote
1 answer
How Stateless EJB rollback JPA transactions
Having for eg:
@Stateless
public class EntityRepositry{
@Inject
EntityManager em;
public void create(Entity e){
// op1 success
// op2 failed
}
}
As Stateless EJB are by default transactional, I would understand how…

zouari
- 967
- 1
- 6
- 13
1
vote
1 answer
The effective way for Hibernate Stateless Session batch inserting with associated instance
I am trying to use Hibernate stateless session to do batch insertion
class Book {
String title;
String author;
Double price;
Publisher publisher;
static constraints = {
publisher nullable: true
}
static mapping…

yang wang
- 163
- 11
1
vote
0 answers
How to prevent sending login/password on each request on a REST API stateless?
A RESTful API need to be stateless, so we can't save context data on the server side. But, I don't want to send login/password on each request for security reasons. So, I would like to known if the way described below respect the article « 5.1.3…

lakano
- 29
- 3
1
vote
1 answer
Stateless session inside @Transactional
I'm currently having problem with executing transaction inside stateless session.
On a service layer i have defined transaction using @Transactional annotation (which is required because the methods needs to be in one transaction).
Inside the method…

toucheqt
- 725
- 2
- 8
- 15
1
vote
1 answer
Duplicate session creation & duplicate threads in AuthenticationProvider? Why?
So I have some Spring Boot Security code, and for some reason although my STATELESS angular app sends a single GET request. The Spring Security seems to get two requests and start processing them in the same milliseconds on two threads (then I end…

Dexter
- 6,170
- 18
- 74
- 101