isopropylcyanide / Jwt-Spring-Security-JPA

Backend MVP showcasing JWT (Json Web Token) authentication with multiple login, timeout / refresh / logout (with in memory invalidation) using Spring Security & MySQL JPA.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stackoverflow issue

PANKAJ-DEV-IND opened this issue · comments

During login time , you were save device info inside refresh token structure with user detail and same refresh token structure you are save inside device info structure which is creating like recursion. How we can solve stackoverflow error.

Hi @Pankaj-1895 can you please share the trace and the steps to reproduce?

Actually I didn't run the code . I was just seeking your flow so I found recursion step there so doubt arise then only I thought you didn't got any stackoverflow error.

No, there's no stack frames being overflown here. The bidirectional mapping works because both entities are in persistent (managed) state. The foreign key references hold true as well.

Both entities are flushed from the hibernate cache to the DB together.

Ok , I Agree with you , but foreign key references mean your primary key of other table with you current table . So we are talking about key but by your code it seem whole structure(model) in nested form including key too. In General I am asking not only in JAVA , i think it can be done in alternate way without doing whole model in recursive . For one time of being i understand you also understand but if third person is not understand then its difficult for him.

Yes, it can be done in other ways. If I could, I would scrape Hibernate off of this project for good. It's good for quick PoC's but gets unmaintainable when the codebase gets bigger.

Considering its jargons and the discourse from JPA standard in some aspects.