Transactions and ASP.NET Membership

J

Jonathan Wood

I'm using ASP.NET membership but need to store some additional data
associated with users in my own database tables. (Profiles don't look like a
good fit for me.)

I'd really like to use transactions to ensure all tables get updates
correctly.

I don't suppose there is any way to have a transaction include creating the
user through membership (probably using Membership.CreateUser and
Roles.AddUserToRole) is there? That is, I don't suppose there is any way to
have a rollback also rollback tasks performed by ASP.NET membership.

Thanks for any comments.
 
C

coolCoder

I'm using ASP.NET membership but need to store some additional data
associated with users in my own database tables. (Profiles don't look like a
good fit for me.)

I'd really like to use transactions to ensure all tables get updates
correctly.

I don't suppose there is any way to have a transaction include creating the
user through membership (probably using Membership.CreateUser and
Roles.AddUserToRole) is there? That is, I don't suppose there is any way to
have a rollback also rollback tasks performed by ASP.NET membership.

Thanks for any comments.

You can always extend the Membership provider by extending the
existing one. This will solve all your problems, since then you can
add your own logic for transactions and whatever you want. Just search
google for some good samples.
 
J

Jonathan Wood

coolCoder,
You can always extend the Membership provider by extending the
existing one. This will solve all your problems, since then you can
add your own logic for transactions and whatever you want. Just search
google for some good samples.

Thanks, but can you elaborate at all? I indicated Profiles don't look like a
good fit for me. In what way would I extend the membership provided?
 
C

coolCoder

coolCoder,





Thanks, but can you elaborate at all? I indicated Profiles don't look like a
good fit for me. In what way would I extend the membership provided?

Here are two links, which explains the process in details.

http://www.15seconds.com/issue/050216.htm
http://www.devx.com/asp/Article/29256

After you read those articles, or search for more on the web, you will
understand that all the features you always wanted can be incorporated
in the Membership Provider you will write.
You can add Transaction support in your method implementations. But
please make sure that while you do that, you don't change signatures
of methods. If you do so, Login or other controls may
not work properly.
Talking about extra data in your own tables, you can do that in your
implementation of the membership provider.
Hope I am clear now.
 
J

Jonathan Wood

Okay, so you're just talking about implementing a custom my own provider.
I'm familiar with that but am not certain that's what I want to do.

I'll read those articles.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top