Hi,
I have this scenario in my Spring MVC Apps.
User has to choose what hobbies he/she likes. He can choose at least one or many hobbies. My problem is this, If I need to save the list of hobbies into my DB, I am thinking of sending the list of hobbies that my user has chosen, delimited by a comma separator.
Its like this: Baskteball, Singing, Dancing, Bowling
Now, In my stored procedure call in my DB called by JDBC DAO, I will just parse the List of string and then perform Insert Statements one by one?
I can use also the
Begin Try
Begin Tran
//perform series of inserts here
Commit Tran
End Try
Begin Catch
Rollback Tran
End Catch
I am thinking that this will limit the amount of transaction from my Spring JDBC to DB. This would guard me also from having incomplete transaction should the second or third insert fails.
I have heard about Spring Transaction Management feature but I really haven't had the chance to study it yet and I am sticking to what I know so far because of Time Constraint. Spring has so many modules and I do not have the time to study them all.
Do you think, given my current knowledge of Spring, my idea is OK? Would like to hear others comments here please.