What do you need to do with the structure that your insertNewsSubscriptions
method returns?
Basically, I would just like some confirmation that it has been
inserted. I have used a struct to return both an instert status
(success or failure) and the new recordID for other set methods. Since
this is
I've learned from years in the trenches. I'm by no means an expert. (My
degree is Art History and African Cultural Studies - if that tells you
anything.) Read CF-Talk, CFDJ, various blogs. Learn by doing. Pick up some
books when you need to. It'll come.
What do you need to do with the structure th
The CFDJ is full of this stuff, e.g. the recent article at:
http://coldfusion.sys-con.com/read/167939.htm
On 2/14/06, Aaron Roberson <[EMAIL PROTECTED]> wrote:
> I am going to have to look into this... I am venturing into the
> unkown. I have read up on CreateObject, but is was all abstract at t
In the instance example, you'd use CreateObject and call init(userid)
once. Then you'd call AddNewsLetter(newsletterid) 3 times instead.
I am going to have to look into this... I am venturing into the
unkown. I have read up on CreateObject, but is was all abstract at the
time. I will also have t
I can answer this bit - yes, a similar situation exists in CF. The
CFC is like a class, which you can instantiate with CreateObject() or
CFOBJECT.
If code uses CFINVOKE, specifying a path to the CFC file, it actually
instantiates the CFC first (in the background) and then runs the
method. This is
If I may, I would like to give you a little more information about my
application.
Our organization has one main website, and several supporting
websites. What I would like to do is for anyone on any site to be able
to register as a user, and for their information to be entered into a
single datab
One more thing...
My insertNewsSubscriptions method returns a structure. If I
instantiate the method within the user method, how do I return the
struct and should I add the results to the struct that the user method
returns?
-Aaron
Oh, and where did you learn to program? I am wishing more and mo
I'm no OO expert. I only come at it from CF. So, I can't answer your last
question. As to your first question, yes, you'd call the insertNews _after_
you have created the userid. If you do what another person suggested,
though, you can actually create the userid (as a UUID) when you create the
user
Deanna,
Thank you very much. Wether or not I invoke or instantiate, am I
correct in assuming that I should pass the userID to the newsmanager
after inserting the user into the users table? Otherwise, the db may
not let me insert the userID in the linking table without a
corresponding userID in th
Yes, that's one way to do it. You can also instantiate an instance of the
newsletter cfc and call the methods directly. So..;
.
>
Whether your want to instantiate or invoke depends on the life cycle of your
user object and whether or not you want t
Deanna wrote:
Well, you could have some object aggregation. So, for example, the user CFC
could have an instance of the newsletterManager cfc. So, if a new user is
created, and they've requested access to certain newsletters, you'd just run
the functions from within the user cfc. Or, if you instant
The MAX(ID) technique only works 100% if you use a serializable
transaction in the cftransaction tag, which can impact performance.
On 2/12/06, Mike Soultanian <[EMAIL PROTECTED]> wrote:
> If you're sure about that, go with it. However, from a previous
> conversation, it didn't seem that was the
If you're sure about that, go with it. However, from a previous
conversation, it didn't seem that was the consensus... but I could very
well be wrong...
Mike
Aaron Rouse wrote:
> It does a transaction in the database itself, assuming the database being
> used supports transactions. This would
It does a transaction in the database itself, assuming the database being
used supports transactions. This would ensure that you get back the ID that
you just inserted.
On 2/11/06, Mike Soultanian <[EMAIL PROTECTED]> wrote:
>
> Aaron Roberson wrote:
> > Mike,
> >
> > I will look into that. I thou
Aaron Roberson wrote:
> Mike,
>
> I will look into that. I thought as long as I wrapped the insert user
> query and the select user query (with the max() function) in a
> cftransaction tag that I would eliminate race conditions and therefore
> would return the correct userID. Is that incorrect?
I
I'd do it this way too. You can mix this with the UUID idea; you
create the user with a new UUID, get it into the DB etc and then
manage this user's newletters with the newsletter manager CFC. It
means the newsletter info becomes a property of the user, which makes
sense; users have newsletters and
Yes, that avoids the whole issue of autonumbers and also allows you
two merge separate databases later on if so desired.
On 2/11/06, Aaron Roberson <[EMAIL PROTECTED]> wrote:
> Could all of this be avoided if I just used the createUUID() function
> to insert a userID into my users table instead of
For reference, here is my user.cfc thus far:
Deanna Schneider wrote:
> Well, you could have some object aggregation. So, for example, the user CFC
> could have an instance of the newsletterManager cfc. So, if a new user is
> created, and they've requested access to certain newsletters, you'd just run
> the functions from within the user cfc.
Could all of this be avoided if I just used the createUUID() function
to insert a userID into my users table instead of using autonumber? I
am starting this thing from scratch, so I could removed the
auto_increment from the userID if I have to.
I am assuming that I would then pass the UUID to both
Mike,
I will look into that. I thought as long as I wrapped the insert user
query and the select user query (with the max() function) in a
cftransaction tag that I would eliminate race conditions and therefore
would return the correct userID. Is that incorrect?
About getting the userID to the new
Well, you could have some object aggregation. So, for example, the user CFC
could have an instance of the newsletterManager cfc. So, if a new user is
created, and they've requested access to certain newsletters, you'd just run
the functions from within the user cfc. Or, if you instantiate a user as
remember, max may not give you what you want, especially if another user
inserts a record just in between the time when you insert your record
and then poll for the max id.
I'm not sure if mysql supports nextval (like oracle), but you might want
to do something like this instead:
http://jamest
Thanks for the link!
Actually, I do know how to get the unique ID with the MAX() function in SQL.
I guess my real question is how do I pass the unique ID from one
method in the users component into another method in the newsletter
component? Can anyone help with that?
-Aaron
On 2/10/06, C. Hat
> I am running MySQL 4.0.25 remotely on my production server and 4.1.12
> on my local box.
I can't help you with the CFC's but you mihgt look into this page for some help
http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
Hatton
~
No problem,
I am running MySQL 4.0.25 remotely on my production server and 4.1.12
on my local box.
I have designed part of my newsletter component, here it is thus far:
On 2/10/06, Aaron Roberson <[EMAIL PROTECTED]> wrote:
> I have three tables: Users, NewsUsers (linking table), NewsCategories
> How do I insert a new user in the user table, retrieve the newly
> created userID and insert it into the newsUsers linking table, and
> insert the newscatID into the news
I have three tables: Users, NewsUsers (linking table), NewsCategories
Users
userID (pk)
userFirst
userLast
userEmail
userPassword
NewsUsers
user_ID (fk)
newscat_ID (fk)
NewsCategories
newscatID (pk)
newscatTitle
How do I insert a new user in the user table, retrieve t
28 matches
Mail list logo