Questions on Room State
Hey guys,
I got some questions on room state:
1) Does the room state actually take some effect or just an indicating flag? For example, if a room state is ROOM_STATE_ENDED, will it prevent any incoming user connection?
2) I tried to login as a guest, the room setting is HostNotArrived. Then I logged in as an owner. The state was switched to Active. The result seems fine until now. However, when I quit the owner app by closing the brower tab, and checked the quest page, the room state was still in Active, rather than switch back to HostNotArrived or any other state. Is it an expected result? How can I let the room state update to date if the owner quit in this way?
3) For my scenario, I'd like to build a room only avaiable when owner arrived. That is, if a guest arrived before the owner arrived or after the owner left, he will not be allowed to do anything , even the connection should be rejected. Is that possible?
Thanks a lot!
Jinni
Hi Jinni,
1) It should prevent any incoming connection other than OWNERs of the room.
2) HostNotArrived happens only before a room has been "kicked off" by the owner, and not afterwards (even if the owner has left the room, it's still fair to say he had "arrived").
3) I'm not sure there's a perfect way to do this yet. We'll be looking into this use case, which feels like you need some "server-to-server" integration : the ability to detect an owner has left, then a way to shut down the room. Does that seem right to you? For now, a quick way of achieving the functionality (if not the security) is to have your clients detect that there's no owner, and disconnect.
hope that helps
nigel
Similar Messages
-
Question about 'write' statement
Hi,
A question on write statement.
I have a internal table itab which has field var. I am looping at this itab and writing horizontal heading output like below.
example on the output heading:
(3 spaces) itab-var (20 spaces) itab-var (20 spaces) itab-var.
the coding is:
loop at itab.
write: 3 itab-var.
endloop.
I want to increase the space by 20 for every loop. How to increase this 3 by 20? Can we accomplish this way?
Thank you for your time.hi krishen,
just add 20 inside the loop , so that after every loop its value increases by 20
for example:
data: v type i.
v=3.
do 3 times.
write: at v(20).
v=v+20.
end do.
hope it will help you
regards
Rahul sharma
Edited by: RAHUL SHARMA on Sep 4, 2008 7:47 AM -
Question about delete statement
I have question about delete statement...
i am performing some simple delete statement against one table..but its taking so long..How can we check whether particular delete statements actually deleting records or not..?Is the associated select-statement returning rows or not?
If yes -> delete is deleting
If no -> delete is just using CPU-cycles
To tune the delete-statement, you have to tune the corresponding select-statement. To tune the select-statement, you want to read the thread When your query takes too long ... -
Beginner question about prepared statements...PLEASE help! :-)
First let me say thanks for the assistance. This is probably really easy to do, but I'm new to JSP and can't seem to figure it out.
I want to dynamically populate a table that shows whether a particular person has an appointment at a given date and time with a user. To do this, I want to query the MySQL database for the lastname of the person with the appointment that occurs with the user at the year, month, date, and time, in question.
THE CODE BELOW DOESN'T WORK (obviously) BUT SOMEWHAT ILLUSTRATES WHAT I'M TRYING TO ACCOMPLISH:
<%
Driver DriverTestRecordSet = (Driver)Class.forName(MM_website_DRIVER).newInstance();
Connection ConnTestRecordSet = DriverManager.getConnection(MM_website_STRING,MM_website_USERNAME,MM_website_PASSWORD);
PreparedStatement StatementTestRecordSet = ConnTestRecordSet.prepareStatement("SELECT lastname FROM appts_pid1 WHERE user_id='<%=(((Recordset1_data = Recordset1.getObject(user_id))==null || Recordset1.wasNull())?"":Recordset1_data)%>' AND year='<%= yy %>' AND month='<%= months[mm] %>' AND date='<%= dates[dd] %>' AND appttime='16:15:00'");
ResultSet TestRecordSet = StatementTestRecordSet.executeQuery();
boolean TestRecordSet_isEmpty = !TestRecordSet.next();
boolean TestRecordSet_hasData = !TestRecordSet_isEmpty;
Object TestRecordSet_data;
int TestRecordSet_numRows = 0;
%>
The real problem comes in the prepared statement portion. If I build the prepared statement with static values like below, EVERYTHING WORKS GREAT:
PreparedStatement StatementTestRecordSet = ConnTestRecordSet.prepareStatement("SELECT lastname FROM appts_pid1 WHERE user_id='1' AND year='2002' AND month='October' AND date='31' AND appttime='16:15:00'");
But when I try to use dynamic values, everything falls apart. It's not that the values aren't defined, I use the user_id, year <%= yy %>, month <%= months[mm] %>, etc. elsewhere on the page with no problems. It's just that I can't figure out how to use these dynamic values within the prepared statement.
Thanks for reading this far and thanks in advance for the help!!!!Hi PhineasGage
You are little bit wrong in your
your preparedStatement.
Expression tag within scriptlet tag is invalid.
Whenever you are appending the statement with
expression tag, append it with "+" and remove
expression tag.
Hopefully it will work
ThanksThanks for the response!
I know that the expression tag within scriptlet tag is invalid. I just need a workaround for what I want to do.
I'm unclear what you mean by "Whenever you are appending the statement with expression tag, append it with a "+" and remove expression tag".
Could you give an example?
In the meantime, I've been trying to digest the docs on prepared statements and have changed the code to look like:
PreparedStatement StatementTestRecordSet = ConnTestRecordSet.prepareStatement("SELECT lastname FROM appts_pid1 WHERE user_id= ? AND year= ? AND month= ? AND date= ? AND appttime='13:15:00'");
StatementTestRecordSet.setInt(1,1);
StatementTestRecordSet.setInt(2,2002);
StatementTestRecordSet.setString(3,"October");
StatementTestRecordSet.setInt(4,31);
Again, WITH THE STATIC VALUES, THIS WORKS FINE...but when I try to use expressions or variables like below, things don't work:
StatementTestRecordSet.setInt(2,<%= yy %>);
Obviously, I'm doing something wrong, but there has to be a way to use variables within the prepared statement.
ALSO, the values are being passed to this page via URL in the form:
samplepage?user_id=1&year=2002&month=October&date=31
Based upon this information, is there another way (outside of stored procedures in the db) to do what I want to do? I'm open to ideas. -
A question About SUBMIT statement
Hi,
By SUBMIT statement, i can trigger another report. If the called report runs into dump, how can i detech/catch the dump in the calling report? I tested. It seems impossible to catch the dump. The calling report will also dump.
My question is, if the called report runs into dump, how to detect the dump and avoid dump in calling report?
Thanks in advance,
Best Regards, Johnney.hi
you can catch this kind of error or exeption from the respective report
then pass this error or exeception to the calling report
go through the example I am giving , ti have done it like this only
SUBMIT zgurep03 AND RETURN WITH SELECTION-TABLE li_seltab .
then in the called reprot
*Check ledger
SELECT SINGLE * FROM t881 WHERE rldnr = p_rldnr.
IF sy-subrc NE 0.
SET CURSOR FIELD 'P_RLDNR'.
MESSAGE e448 WITH p_rldnr
MESSAGE e446 INTO lv_text .
lv_type = 'E'.
Capturing the error messages.
EXPORT lv_text TO MEMORY ID 'TX'(004).
EXPORT lv_type TO MEMORY ID 'TP'(005).
in calling report
IMPORT gv_type1 TO gv_type FROM MEMORY ID 'TP'.
IMPORT gv_text1 TO gv_text FROM MEMORY ID 'TX'.
preparing error message in the callge report for the calling report
PERFORM prepare_message
USING sy-msgid
lv_msgno
lv_msgv1
lv_msgv2
lv_msgv3
lv_msgv4
CHANGING gv_text.
preparing error message
FORM prepare_message USING p_sy_msgid
p_sy_msgno
p_sy_msgv1
p_sy_msgv2
p_sy_msgv3
p_sy_msgv4
CHANGING p_gv_text.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = p_sy_msgid
lang = 'EN'
no = p_sy_msgno
v1 = p_sy_msgv1
v2 = p_sy_msgv2
v3 = p_sy_msgv3
v4 = p_sy_msgv4
IMPORTING
msg = gv_text
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
I guess this will solve your problem
Regards
Prashant -
Question about call statement in trigger
I faced a question in written exam.
A CALL statement inside a trigger allow us to call
a)package
b)procedure
c)function
d)another trigger
Can anyone give me answer with reason?
I used CALL statement inside trigger but not allowing to use it. Might be earlier in oracle CALL statement we can use..its only a guess so I am asking in forum..
plz guide me..
rgds,
pcYou can use CALL in a trigger without resorting to EXECUTE IMMEDIATE
SQL> create table t1 (
2 col1 number
3 );
Table created.
SQL> create procedure t1_proc
2 as
3 begin
4 dbms_output.put_line( 'In T1_PROC' );
5 end;
6 /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 create trigger trg_t1
2 before insert on t1
3 for each row
4* call t1_proc
5 /
Trigger created.
SQL> set serveroutput on;
SQL> insert into t1 values( 1 );
In T1_PROC
1 row created.I can't think of any reason that you'd actually intentionally structure your code this way in this day and age because it would be rather likely to cause confusion for whoever had to support this in the future. But it is valid syntax that probably made sense back in Oracle 5.
Justin -
Hello Gurus,
as for a statement "The MBW job BI_BTCH__FX_PAYMENT_DATA=X10M and itu2019s child job ended with completed Abnormally status.", I have some question as follows:
(1) where does they check out this job " BI_BTCH__FX_PAYMENT_DATA=X10M " ? what do that "=" and "X10M" and "BI_BTCH__FX_PAYMENT_DATA" mean ?
(2) how does " MBW job BI_BTCH__FX_PAYMENT_DATA=X10M " match some BW object?
(3) what is itu2019s child job ?
MaIs the associated select-statement returning rows or not?
If yes -> delete is deleting
If no -> delete is just using CPU-cycles
To tune the delete-statement, you have to tune the corresponding select-statement. To tune the select-statement, you want to read the thread When your query takes too long ... -
Question about conversational state of Stateless bean....
Hello all,
I have a simple stateless bean which parses an XML file and stores the xml content as an list of 2-D arrays in member variables. Here is quick look at design...
import javax.ejb.Stateless;
// included other libraries
import java.util.List;
import java.util.ArrayList;
@Stateless
public class XMLParseBean implements XMLParseBeanInterface {
public List<String> strParameters;
public List<String> getStrParameters() {
return strParameters;
private void setStrParameters(List<String> strParameters) {
this.strParameters = strParameters;
public void parseXML(String strFileName) {
/* Open the XML file and do initializations for xml parsing here
setStrParameters(visitNode(doc.getDocumentElement()));
private List<String> visitNode(Element thisNode) {
/* Parse the XML here */
return strNodes; // return the node names and their values
}My question is : if I inject this bean in another bean, call the method for parsing XML and then call the getParameter method to access the value of member variable, will it work.
I mean since I am using stateless bean, does the conversation state end when the parseXML method ends?sir_edward wrote:
Hi vikram8jp,
The session of an stateless bean ends after a method call. If you call a method of your bean, the bean will forget all attributes when the method ends. If you want to save attributes, you have to use a stateful bean.
Regards
Sir EdwardHello Sir Edward,
That answers my query. -
Questions on select statement in the data model
Hi,
In the select statement, the order by statement seems only to work at the lowest level of the select statement. Is this true?
What is the the purpose of the group by statement in the select statement?
As far as I understand, the grouping is catered for in the data model.....
Regards,
KinFrom the oracle report docs:
The order of column values in a default group is
determined by the ORDER BY clause of the query for
SQL queries and by the sort column for Express queries.
For column values in user-created groups, however, you
must use Break Order to specify how to order the break
column's values.So order by in your sql query is affected by groups in your data model.
The purpose of a group by statement in your select statement is to group values for aggregation purposes, like
select department_id,
min(salary),
max (salary)
from employees
group
by department_id
order
by department_id;Grouping in the data model of a report is a little different than a group by clause, but not entirely. -
Java Newbie Question - the import statement
Hi Geeks,
I have a problem for importing a java .class in my project. This latter is named "Tedetis_New". Inside it, I created a "src" folder containing all the source code of the application. I import a jar file inside the parent directory of "src" (i.e. at the root of the project). Inside this jar archive, two classes (.class files) are not placed inside a package (default package according to eclipse), let's name one toto.class. So when I want to import toto.class from a file inside the src directory I simply do "import toto.class" but this statement doesn't work ! I don't manage to import my toto.class so ... what do you propose for this ?
Thanks.Don't use the "default" class for anything serious;
you can't import such a class.Er, package maybe?Yes, I was editing my reply while you replied to my reply so I couldn't
edit my little blooper in my reply anymore; thank you very much Sir ;-)
kind regards,
JosI entered that response as quickly as I could, for just that reason. I
thought you might notice and try to correct it, and I wanted to preserve
your fuckupus maximus for all eternity.
Everyone gather round and taunt Jos! Wave your private parts at his
auntie! Fart in his general direction!
Now, aren't you glad you didn't say "Jehovah"?I already knew that you were the one who invented amiability ;-)
kind regards,
Jehov^H^H^H^Hos -
Some questions on import statements.
When I see
import java.awt.*
import java.awt.event.*
am I on track interpreting this to mean that you want to be able to use any of the classes found in package java.awt?
why would import java.awt.event.* be necessary if event is a class in the java.awt.* package you're importing in the second import statement up above?
does * mean like a "wildcard" which allows you to utilize
anything that is part of java.awt?It allows you to use any of the classes in that directory, but not any classes in sub-directories of that directory.
-
Interview question for sql statement
Hi Guys,
In a interview i was asked the following question considering i m using database 9i
Quote
If a client is running a query and that client complains you that query is stuck and he is not sure if that query is slow or it is not running at all, how a DBA can know the status of that query
Unquote
any responce will be appreciated
regards
Anscol sql_text format a50
col opname format a20
col machine format a10
col username format a10
col action format a10
set linesize 200
select /*+ ORDERED */
sl.username
,sl.opname
,sl.start_time
,sl.last_update_time
,sl.time_remaining
,sl.elapsed_seconds
,sa.sql_text
from v$sqlarea sa,v$session_longops sl
where sl.sql_hash_value = sa.hash_value
and sl.sql_address = sa.address
col sql_text format a45
col machine format a10
col username format a10
col action format a10
set linesize 200
SELECT /*+ ORDERED */
username
,S.LAST_CALL_ET
,to_char(LOGON_TIME,'DD/MM/YY HH24:MM:SS') Logon_Time
,s.action
,S.STATUS
,s.PROCESS
,s.sid
,s.serial#
, s.machine
, X.sql_text
FROM sys
.v_$session S
LEFT OUTER JOIN sys.v_$sqlarea X
ON s.sql_address = x.address
AND s.sql_hash_value = x.hash_value
WHERE s.type != 'BACKGROUND'
ORDER BY 2,1
/ -
Question in Case Statement....
Hi Gurus, I have a case statement as below: Here I have to get the Initials of person only where desc = underwriter. ( P.S sometimes there are multiple underwriter, thats why i put the min() around a character.)
Initials =
min(case when ( table1.DESC ) = 'UNDERWRITER' then table2.INITIALS when ( table1.DESC ) ='ASSIGN' then table2.INITIALS end )
Please see data below:
Underwriter Initials : SE
-------------------------------XY
Assign Initials : NR
----------------------------PQ
Through my SQL I intend to get SE for Underwriter. But my SQL returns NR as it it is the minimum in the order. Any ideas please...........
P.S: The Initials column is actually displayed in one of my reports; and the Initials column is dynamic; meaning ....i am prompting the User to select DESC values: Underwriter or Assign
and based on that the prompt; the Initials Column should display either Underwriter Initials or Assign Initials.
Thanks a lot.Hi Frank, thanks a lot for your reply. I am a lot closer to solving it now. A little more help please.
The expected output is like below:
1) Initials 2) Desc
SE-------------- Underwriter
NR---------------Assign
Yes , i understand the whole purpose of case is to give different scnarios but in this case i have tried using something like:
case when CR_ROLE_TYPE_DESC_REF.ROLE_TYP_DESC = :p_role_typ_desc then CR_PARTY_DIM.PARTY_NAME_INITIALS end
but it gives me the wrong values. which i think is due to the Decode statement below:
Please see the modified SQL:
Here the user chooses prompts (DESC: Underwriter) and also pick a person name which has a decode for ASSIGN in it
SELECT
CR_ACCOUNT_DIM.ACCOUNT_NM,
min(case when ( CR_ROLE_TYPE_DESC_REF.ROLE_TYP_DESC ) = 'UNDERWRITER' then CR_PARTY_DIM.PARTY_NAME_INITIALS when ( CR_ROLE_TYPE_DESC_REF.ROLE_TYP_DESC ) ='ASSIGN' then CR_PARTY_DIM.PARTY_NAME_INITIALS end)
FROM
CR_ACCOUNT_DIM,
CR_CNSMR_RQST_PARTY_ROLE_RLSHP,
CR_PARTY_DIM,
CR_CONSUMER_RQST_DIM,
CR_BUSINESS_SGMNT_REF,
CR_CONSUMER_RQST_FACT
WHERE
( CR_CONSUMER_RQST_FACT.CNSMR_RQST_DIM_PK_ID=CR_CONSUMER_RQST_DIM.CNSMR_RQST_DIM_PK_ID )
AND ( CR_PARTY_DIM.PARTY_DIM_PK_ID= CR_CNSMR_RQST_PARTY_ROLE_RLSHP.PARTY_DIM_PK_ID )
and
decode(CR_CNSMR_RQST_PARTY_ROLE_RLSHP.ROLE_TYP_DESC,'ASSIGN',CR_PARTY_DIM.FIRST_NM || ' ' || CR_PARTY_DIM.MIDDLE_INTL || ' ' || CR_PARTY_DIM.LAST_NM ) = 'ROBERTO NIEL'
Any ideas please.... -
Newbie question about switch statement
Lets say you have a loop and inside the loop you have a switch statement, how do you BREAK out of the outer loop?
for (i=0....) {
switch {
case 11:
.... some stuff
break; <==== HOW DO I BREAK OUT OF THE for loop here?In standard C and standard C++ the break statement terminates the nearest enclosing loop and only that loop; i.e. control transfers to the first statement following the loop. I think there are C or C++ extensions that allow loop tags which may be used with a break to specify which loop to drop through, but I don't think these are supported by gcc, and they would certainly be very non-portable.
There are several common ways to drop out of one or more outer loops. In many cases, there's nothing else in the loop following the switch so you can simply write
switch (condition) {
default:
case 0:
break;
// other case statements here
break;
Else you can declare a loop control var and use the continue statement like this:
for (i=0; i<jMax && !bDone; i++) {
switch (condition) {
default:
case 0:
bDone++; continue;
// other case statements
If you need to escape several loops and/or don't want to use loop control vars, you might consider structuring the code so you can use return to terminate the entire function. In the worst case of a very complex structure that you don't know how to simplify with a helper function, you can always resort to a goto:
switch (condition) {
default:
case 0:
goto escape;
// other case statements here
// remainder of code inside nested loops here
escape: <first statement following the outermost loop>;
Note that the statement following the escape label is always executed; i.e. when execution skips the goto it's as if the statement following escape was unlabeled. Use goto sparingly of course, since it's an artifact of unstructured programming. But when you really need a goto, it can make your code much easier to maintain. -
Newbie question :- An IN statement question
I have the following issue.
I want to use an IN statement (As below), This will enable the user to enter upto 5 serial numbers.
select col.contract, col.order_no, col.customer_no, ci.name Customer_Name, odn.ship_address1, odn.ship_address2, odn.ship_zip_code, odn.ship_city, odn.ship_county, co.customer_po_no, col.part_no, col.catalog_desc Description, ith.serial_no,
col.real_ship_date Ship_Date
from
customer_order_line col,
customer_info ci,
inventory_transaction_hist ith,
customer_order co,
customer_order_deliv_note odn
where
col.customer_no = ci.customer_id
and
col.contract = ith.contract
and
col.order_no = ith.order_no
and
col.part_no = ith.part_no
and
col.order_no = co.order_no
and
col.contract = co.contract
and
col.contract = odn.contract(+)
and
col.order_no = odn.order_no(+)
and
ith.serial_no IN ('&S1' , '&S2' , '&S3' , '&S4' , '&S5')
and
(('&FROM_DATE') is null or ('&TO_DATE') is null or
dated between to_date('&FROM_DATE','DD/MM/YYYY') and to_date('&TO_DATE','DD/MM/YYYY') + ( 1 - 1/ ( 60*60*24 )))
The problem is that if they don't enter any serial numbers it return no values.. (it should do).. How can I I amend this SQl so if S1/2/3/4/5 has null values it does return some data
Message was edited by:
HoLy_PiLgRiMHi,
Well it will return customer order's, If I took out the IN statement and run it.. it will promt me for a date range and it will return a load of Customer Orders within that date range..
With the IN statement, If I put a serial number and and specify a date range it will only bring back customers orders with that serial number in them.. The problem is if they don't specify a serial number and enter a date range nothing comes back ? It like I need to enter and if null blah blah
Maybe you are looking for
-
Inifile created by the application builder
Why is an almost empty ini file (with the same name as the executable) always created in the installation folder when installing a labview program created with the application builder? I want to distrubute my own inifile with the installer but it sea
-
Servicegen issue with binding webservices.jar
Hey, I am trying to build a ejb webservice using ant and servicegen. When I run it, it blows up and gives me a ton of binding errors. The problem is the binding errors are on files from the webservices.jar not from my jar. What is wrong with my scrip
-
PO Print SAP scripts:Grand total field -- High priority
Hi experts In a PO print out, For example in one line item ,I have conditions printed as below Line iem 1. Gross price -- 1000 VAT% 40 Service Tax - 123.36 Net. Incl. Disc. 1163.36 Line iem 2. Gross price -- 500 VAT% 20 Service Tax - 61.8 Net. Incl.
-
Search with special characters in Internet Sales
Hi, In the Internet Sales application, a user can search for products. When it uses as search query A3+ i only want to have products with A3+ but now it returns all the A3 as well without the plus sign. I assume that the + sign has a special meaning
-
Opening a Specific Tab for each Navigation to Summary page.
Hi, My JDeveloper version - 11.1.1.6.0 I have a summary page with 4 tabs.( General Information, Design, Channels and Capacity). I have a table displaying list of entities. When I double click the entity, I open the summary page as a region. First tim