Hi Everybody,
I am using Spring & Hibernate for my application. Untill recently, DBCP Basic data source was used but we have changed it to XA data source -- atomikos lately.
Now the strange problem I am facing is,
I have a SSN attribute defined in User class. I have saved a User Object. While saving it to the database I am using JASYPT encryption for storing SSN. The encrypted string when it is decrypted manually i.e in command prompt it is giving correct SSN number.
In the same service class I have another method which gets the user details and masks the SSN (say XXX-XX-1234). This is used for UI purpose.
Now before performing an operation which uses actual SSN, if I check in the database the encrypted value of SSN changed. And, while I decrypted in cmd prompt, to my surprise it came out to be XXX-XX-1234. I have checked thoroughly there is no save operation of User entity anywhere after masking has been done.
When I reverted back to DBCP datasource everything is functioning normally.
I am fairly new to using XA datasource and in using Hibernate. So can anyone kindly help me in resolving this issue?
Thanks, Vivekanand Alampally.
|