[flexcoders] Why hhtpservice is too long

2011-10-21 Thread isa_loyer
Dear flexer,

I try to load a datagrid with httpservice.
But, I'm so desapointed because load about 17000 lines take around 5 sec.
So can you help me to optimize this time.

?php 

// Send the content-type header:
header('Content-Type: text/xml');


// Include the database information script:
require_once ('MySQL.php');
require_once ('conf.php');
include('functions.php');

// Connect to the database:
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PWD, DB_DATABASE);

// If a connection was established, run the query:
if ($dbc) { 

// Define the query:
$q ='SELECT 20Patients_1012.paIndex, 20Patients_1012.paNomP, 
20Patients_1012.paPrenom, 20Patients_1012.paCodePostal, 
20Patients_1012.paDossier1, 20Patients_1012.paDossier2, 
20Patients_1012.paNaissance, 20Patients_1012.paNumTel1, 
30Traitemnt_201223.ttTStatutP, 30Traitemnt_201223.ttDateStatut, 
12Praticien_02.prInitiales FROM 20Patients_1012 JOIN 30Traitemnt_201223 ON 
20Patients_1012.paIndex = 30Traitemnt_201223.ttIndex JOIN 12Praticien_02 ON 
30Traitemnt_201223.ttPraticien = 12Praticien_02.prIndex';
}

// Run the query:
$r = mysqli_query($dbc, $q);

$reponse = patients;

// Confirm that some rows were returned:
if (mysqli_num_rows($r)  0) {
// Fetch every row and print it as XML:
while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
 $reponse.=id.$row[0]./idpr.$row[2]./prst
.$row[8]. .$row[9]./std1.$row[4]. / 

.$row[5]./d1dn.$row[6]./dnpr2.$row[10]./pr2
.dn.$row[6]./dn;

} // End of WHILE loop.


} // End of mysqli_num_rows() IF.

} // End of $dbc IF.

// Complete the XML:
$reponse.=/patients;
printf (%s,$reponse);

mysql_free_result($reponse);
?

Thanks



[flexcoders] Question for Flex Builder 3 config file

2011-10-21 Thread markflex2007
Hi,

I have a issue for Flex builder 3. that take too long time buiding a project

I guess I need update the flexbuilder.ini

-vmargs
-Xms512m
-Xmx768m
-XX:MaxPermSize=256m
-XX:PermSize=64m
-Djava.net.preferIPv4Stack=true

I need the setting is related to Java virtul machine.

Would you please explain to me what each lines mean.

Thanks

Mark



[flexcoders] Re: Why hhtpservice is too long

2011-10-21 Thread valdhor
I suggest you move from XML to Remote Objects.

You obviously have control of both the server and the Flex client. Currently 
you are retrieving data from the server and converting it to an XML string that 
you return to Flex. On the Flex side you then decode the XML to a form that you 
can use. That encode/decode cycle adds additional complexity and time to your 
data transfer tasks.

Remote Objects use a compressed binary stream to transfer data. You will 
probably find that the amount of data transferred will be around one tenth of 
what you are currently seeing. There is no need to do any conversion - You 
create objects on the server for each row; Put the objects in an array; And 
return the array to Flex. On the flex side you create an Array Collection from 
the resultant array and can use the objects directly. These objects are called 
DTO (Data Transfer Objects) and generally have no methods attached.

When I first started out with Flex I used XML as that seemed to be the easiest 
way and Remote Objects looked difficult to learn. Once I put in the time to 
learn and found out the benefits I never looked back. Now I only use XML in 
SOAP solutions.

I would also suggest using WebORB for PHP as your middleware for Remote 
Objects. I have been using it for years and it is rock solid. There is a 
community version which is free for use but can also be licensed if you want 
enterprise support.

If you are returning 17,000 rows you probably want to look at data paging of 
your data grid. What I do is calculate the space available to the datagrid and 
calculate the maximum number of rows that can be seen. Then in the request I 
pass an offset and rowcount property to the server. On the server I use these 
properties in a LIMIT clause to MySQL. If the offset is zero I also add 
SQL_CALC_FOUND_ROWS to the query so I can return total number of rows for the 
query so I can calculate the number of pages.

Using both of the above techniques should optimize your data request/response 
times.

--- In flexcoders@yahoogroups.com, isa_loyer isa_loyer@... wrote:

 Dear flexer,
 
 I try to load a datagrid with httpservice.
 But, I'm so desapointed because load about 17000 lines take around 5 sec.
 So can you help me to optimize this time.
 
 ?php 
 
 // Send the content-type header:
 header('Content-Type: text/xml');
 
 
 // Include the database information script:
 require_once ('MySQL.php');
 require_once ('conf.php');
 include('functions.php');
 
 // Connect to the database:
 $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PWD, DB_DATABASE);
 
 // If a connection was established, run the query:
 if ($dbc) { 
 
   // Define the query:
   $q ='SELECT 20Patients_1012.paIndex, 20Patients_1012.paNomP, 
 20Patients_1012.paPrenom, 20Patients_1012.paCodePostal, 
 20Patients_1012.paDossier1, 20Patients_1012.paDossier2, 
 20Patients_1012.paNaissance, 20Patients_1012.paNumTel1, 
 30Traitemnt_201223.ttTStatutP, 30Traitemnt_201223.ttDateStatut, 
 12Praticien_02.prInitiales FROM 20Patients_1012 JOIN 30Traitemnt_201223 ON 
 20Patients_1012.paIndex = 30Traitemnt_201223.ttIndex JOIN 12Praticien_02 ON 
 30Traitemnt_201223.ttPraticien = 12Praticien_02.prIndex';
   }
   
   // Run the query:
   $r = mysqli_query($dbc, $q);
   
   $reponse = patients;
 
   // Confirm that some rows were returned:
   if (mysqli_num_rows($r)  0) {
   // Fetch every row and print it as XML:
   while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
  $reponse.=id.$row[0]./idpr.$row[2]./prst
   .$row[8]. .$row[9]./std1.$row[4]. / 
   
 .$row[5]./d1dn.$row[6]./dnpr2.$row[10]./pr2
   .dn.$row[6]./dn;
 
   } // End of WHILE loop.
   
 
   } // End of mysqli_num_rows() IF.
 
 } // End of $dbc IF.
 
 // Complete the XML:
 $reponse.=/patients;
 printf (%s,$reponse);
 
 mysql_free_result($reponse);
 ?
 
 Thanks





Re: [Bulk] [flexcoders] Re: Why hhtpservice is too long

2011-10-21 Thread Isabelle Loyer Perso













[flexcoders] Fwd: I DID IT!.

2011-10-21 Thread srikanth reddy
pHey, hey.brI was ready to throw in the towel my luck had finally turned 
around these days im making my way to the top this could be your big 
breakbra 
href=http://vnosiznos.com/IanRoberts74.html;http://vnosiznos.com/IanRoberts74.html/abrgoodbye/p