Fornax-Platform
Forum

Saving data to oracle DB issue using JPA.

View: New views
5 Messages — Rating Filter:   Alert me  

Saving data to oracle DB issue using JPA.

by deepshar027 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Guys,

I am trying to save an entity using JPA/hibernate.I see the correct data in session but the save() is not saving the data in the Oracle DB.

I think there is some issue with the data not getting flushed to DB.

Please help!

DS

Re: Saving data to oracle DB issue using JPA.

by Patrik Nordwall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The transaction boundary is at the service layer. Flush is normally done when there, so if you are debugging in repository or data access it is not flushed until returning from the service. What do you mean? Isn't it stored at all? Any exceptions?

/Patrik


deepshar027 wrote:
Guys,

I am trying to save an entity using JPA/hibernate.I see the correct data in session but the save() is not saving the data in the Oracle DB.

I think there is some issue with the data not getting flushed to DB.

Please help!

DS

Re: Saving data to oracle DB issue using JPA.

by deepshar027 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Patrik,

Actually I wasnt getting any error and so I thought it could be some flushing issue.
I read on a forum that data gets saved if inside a transaction.I put the transactional attribute on the service class and the data got saved in DB.

Thanks,
DS


The transaction boundary is at the service layer. Flush is normally done when there, so if you are debugging in repository or data access it is not flushed until returning from the service. What do you mean? Isn't it stored at all? Any exceptions?

/Patrik


deepshar027 wrote:
Guys,

I am trying to save an entity using JPA/hibernate.I see the correct data in session but the save() is not saving the data in the Oracle DB.

I think there is some issue with the data not getting flushed to DB.

Please help!

DS


Re: Saving data to oracle DB issue using JPA.

by Patrik Nordwall :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hmm, but do you think this is a bug in sculptor? You should not have to add transactional attribute, that should be handled by generated code/configuration by sculptor.
What target configuration are you using? ejb+spring?

/Patrik


Patrik,

Actually I wasnt getting any error and so I thought it could be some flushing issue.
I read on a forum that data gets saved if inside a transaction.I put the transactional attribute on the service class and the data got saved in DB.

Thanks,
DS

Patrik Nordwall wrote:
The transaction boundary is at the service layer. Flush is normally done when there, so if you are debugging in repository or data access it is not flushed until returning from the service. What do you mean? Isn't it stored at all? Any exceptions?

/Patrik


deepshar027 wrote:
Guys,

I am trying to save an entity using JPA/hibernate.I see the correct data in session but the save() is not saving the data in the Oracle DB.

I think there is some issue with the data not getting flushed to DB.

Please help!

DS

Re: Saving data to oracle DB issue using JPA.

by deepshar027 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well , I think in that sense its a bug.I think there can be a configurable parameter if we want to support transactions and then sculptor should add that on the service methods.
I am using spring-jpa (No EJB's)



Hmm, but do you think this is a bug in sculptor? You should not have to add transactional attribute, that should be handled by generated code/configuration by sculptor.
What target configuration are you using? ejb+spring?

/Patrik


Patrik,

Actually I wasnt getting any error and so I thought it could be some flushing issue.
I read on a forum that data gets saved if inside a transaction.I put the transactional attribute on the service class and the data got saved in DB.

Thanks,
DS

Patrik Nordwall wrote:
The transaction boundary is at the service layer. Flush is normally done when there, so if you are debugging in repository or data access it is not flushed until returning from the service. What do you mean? Isn't it stored at all? Any exceptions?

/Patrik


deepshar027 wrote:
Guys,

I am trying to save an entity using JPA/hibernate.I see the correct data in session but the save() is not saving the data in the Oracle DB.

I think there is some issue with the data not getting flushed to DB.

Please help!

DS