You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by DG...@EvergreenInvestments.com on 2005/04/08 15:45:46 UTC

[OT] How to transpose a table in MS SQL Server 2000

So, I have the following table:

id      month   val1    val2    total
1       jan     1       2       3
2       feb     3       4       7

And I'd like it transformed to:

ID      VAL     COL1    COL2
1       month   jan     feb
2       val1    1       3 
3       val2    2       4
4       total   3       7

I'm guessing that it's possible, as I've seen variants of this type of 
tranformation.  I have googled this, but the solutions (I've found) are 
considerably more complicated and revolve around summing/aggregating, when 
I just need to change the structure of the results. 

Has anybody seen a solution that fits this problem?

Thanks,
Dennis




DGraham@EvergreenInvestments.com 
04/08/2005 09:26 AM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
"Struts Users Mailing List" <us...@struts.apache.org>
cc

Subject
[OT] RE: concurrency problem






As I hit the send button, something tickled in the back of my mind, and I 
began to remember that the spec forbids thread primitiives on bean methods 

and that the EJB container is responsible for handling concurrent access. 
Sounds like your provider might have a defect.

Dennis





DGraham@EvergreenInvestments.com 
04/08/2005 09:13 AM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
"Struts Users Mailing List" <us...@struts.apache.org>
cc

Subject
RE: concurrency problem






You're synchronizing on an object which is unique for each user, which 
might explain why more than 1 thread can concurrently enter the critsec. 
Wouldn't a better solution be to declare the method as synchronized?

Dennis





"Kalra, Ashwani" <as...@capgemini.com> 
04/08/2005 08:53 AM
Please respond to
"Struts Users Mailing List" <us...@struts.apache.org>


To
"Struts Users Mailing List" <us...@struts.apache.org>
cc

Subject
RE: concurrency problem







Isnt that valid when request is going to same action. In my scenario, 
different actions are invoked quickly and all the actions have this call 
to SFSB.   Which I want to synchronise

Thanks & Regds
 Ashwani

Ext: 1860







> -----Original Message-----
> From: James Mitchell [mailto:jmitchell@apache.org]
> Sent: Friday, April 08, 2005 6:04 PM
> To: Struts Users Mailing List
> Subject: Re: concurrency problem
>

>

> You'd be better off implementing token processing.
>

> Struts includes token generation and helper methods to ensure

> only one valid

> request is handled at a time.  Look at the struts example application

> (mailreader) for an example.
>

> For detailed info on why this pattern works, see:
> http://www.amazon.com/exec/obidos/tg/detail/-/0201634988/ref=l
> pr_g_1/102-8250064-5792120?v=glance&s=books
>

>

>

>

> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> Consulting / Mentoring / Freelance
> EdgeTech, Inc.
> 678.910.8017
> AIM:   jmitchtx
> Yahoo: jmitchtx
> MSN:   jmitchell@apache.org
>

>

>

>

> ----- Original Message -----

> From: "Kalra, Ashwani" <as...@capgemini.com>
> To: "Struts (E-mail)" <us...@struts.apache.org>
> Sent: Friday, April 08, 2005 7:10 AM
> Subject: concurrency problem
>

>

>

> I am facing concurrency problem in following scenario.
>

> All our action classes call same stateful session bean . 

> Each action class

> obtains the reference  from HTTPSession object and calls one

> and only one

> business method.
> To prevent the concurrent access to this instance which

> occurs when user

> immediately presses two links quickly in succession I am

> using the following

> code block
>

>

> execute(...)  //execute methods of Action class
> {
> ....
> ....
>

> //Obtain the session from  Request.User will always be in session here
> session=request.getSession()
> Synchronised(session)
> {
>     //call ejb's  business method.
> }
>

> }
>

> However sometimes  more than one thread is able to pass

> through, And I get

> exception from Appserver. As 2 threads are not allowed for

> statefull Session

> bean.
> Can there be problem in above code. Is it ok to synchronise

> on session

> object.
>

>

>

>

>

> Thanks & Regds
>  Ashwani
>

> Ext: 1860
>

>

>

>

>

>

>

> This message contains information that may be privileged or

> confidential and

> is the property of the Capgemini Group. It is intended only

> for the person

> to whom it is addressed. If you are not the intended

> recipient,  you are not

> authorized to read, print, retain, copy, disseminate, 

> distribute, or use

> this message or any part thereof. If you receive this 

> message in error,

> please notify the sender immediately and delete all  copies

> of this message.
>

>

>

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

>


This message contains information that may be privileged or confidential 
and is the property of the Capgemini Group. It is intended only for the 
person to whom it is addressed. If you are not the intended recipient, you 


are not authorized to read, print, retain, copy, disseminate,  distribute, 


or use this message or any part thereof. If you receive this  message in 
error, please notify the sender immediately and delete all  copies of this 


message.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org